Alternative Conditions
Learn about the alternative condition which executes when the condition gets false.
We'll cover the following...
You’ll often want to have your code execute one way when something’s true and another way when something’s false.
The else
statement
Let’s enrich our sample with different messages depending if the number’s positive or not.
Test this code with a positive number, negative number, and zero, while watching the result in the console. The code executes differently depending on if the ...