Skip to content

Commit dba5f73

Browse files
committed
Moved the comments above the code.
1 parent 5ce25a5 commit dba5f73

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

‎Week1/prep-exercises/1-traffic-light/traffic-light-1.js‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ while (rotations < 2) {
1212
const currentState = trafficLight.state;
1313
console.log("The traffic light is on", currentState);
1414

15+
// TODO
16+
// if the color is green, turn it orange
17+
// if the color is orange, turn it red
18+
// if the color is red, add 1 to rotations and turn it green
19+
1520
if(currentState === "green")
1621
{
1722
trafficLight.state = "orange";
@@ -25,10 +30,7 @@ while (rotations < 2) {
2530
rotations += 1;
2631
trafficLight.state = "green";
2732
}
28-
// TODO
29-
// if the color is green, turn it orange
30-
// if the color is orange, turn it red
31-
// if the color is red, add 1 to rotations and turn it green
33+
3234
}
3335

3436
/**

0 commit comments

Comments
 (0)