JS

JavaScript Fundamentals 1 - Purpose of else statem...

10.

What is the purpose of the else statement in a basic conditional statement in JavaScript?

To define an alternative code block to be executed if the condition in the if statement is true.

To define an alternative code block to be executed if the condition in the if statement is false.

To specify multiple conditions in a single conditional statement.

To break out of the conditional statement and continue with the rest of the code.