We use if/else statements to determine if the statement within the expression within the parentheses is true or false.
The basic syntax of if/else if statements are:
let name = prompt();
if (){
alert();
} else {
alert();
}
The purpose of isNAN is to identify if the expression is not a real number and it would be determined by displaying true or false. Conditions that have && are letting us know both the 1st and 2nd expressions are true. Now conditions with || are letting us know if either the 1st or 2nd expressions are true. The if statements are different from else if statements and else statements because if statements are what is going to be executed.
Reader Interactions
Comments
Leave a Reply
You must be logged in to post a comment.
Nice identification of isNAN and it’s importance in JavaScript.