Javascript level 4 - lesson 4
Use if, else if and else statement to do so.
Use if statement to check if the value of the signal variable is green, if green, print the following on the console: Go
Then use else if statements, to check if the signal is yellow, or red. In the case of yellow, print Wait on the console, and in the case of red, print Stop on the console.
In the else block, print, Error on the console.
For, green = Go,
yellow = Wait,
red = Stop,
and apart from these values = Error.