Course Content
Introduction to JavaScript
else
if
executes code under a certain condition, but it's not very similar to branching. The interpreter simply continues executing the code.

else
The else
keyword is used in conjunction with if
to create conditional statements.

Look at the example:
The else
syntax is like the if
syntax without a condition and parentheses ()
.
Note
If you include an
else
statement, you cannot place the end-of-command (;
) after theif
code block ({}
), as doing so will result in aSyntaxError
.
1. What will be the output?
2. What will be the output?
What will be the output?
Select the correct answer
What will be the output?
Select the correct answer
Section 4.
Chapter 2