In the previous lesson you learnt about compound operators.
The if else block
You can use the else statement when you need to specify what should happen if the condition is not met. For example, you could modify the weatherCheck() method from the previous lesson:
You can also use else to test several alternate conditions:
The following snippet shows an example of using the above method:
In the next lesson you will learn about the ternary operator.