Welcome back.
In this video we're going to look at another really powerful tool called else.
So we have this if statement here.
And let me actually get rid of all of this other stuff here.
So now I'm really only focusing on whether the H is greater equal 18 or not.
So if it is then we can go into the club.
But then what if we aren't 18 or older?
Well then we can do whatever is inside of the else block.
So you see there is this if and then you say whatever should happen if this statement here inside of
those brackets is true, and then you have the else and you're executing this in all other cases.
So in this case when this is not true.
So if this if block is not executed then the else block will be executed.
Okay.
So we can just say go party in the kindergarten or in school.
In school maybe something like that.
So if somebody is 18 or higher they can party in the club, otherwise they can party in school.
So if we run this, we will still get the same result as we did before.
And therefore we need to make sure that we have console dot read key for it to hold our application
hostage until we click a button.
So here it says go party in the club.
Well that's because we are above 18.
But let's say we are 13.
Then we cannot go into the club.
So go party in school.
And that's pretty much it.
That's pretty much how the else block works.
So you're basically saying if this is not true, then execute this else block.
But it is a little more complicated.
And we're going to look at that in the next video when we're looking at else if.
Okay.
So see you there.