We use if/else statement to examine if the condition is true or false. If statements is where the condition of code is true. Else statement is same condition to be false. Lastly else if is for new test if the first condition is false. The basic syntax of if/else statements is from class that helped me understand what if/else statements are.
if (something_is_true){
do something;
}else{
do_something_different
}
“isNaN” stands for is not-a-number when it’s true its value is not a number. It helps converting “the value to a number before testing it” for example
//This returns true;
isNaN(‘Hello’);
//This returns false;
Number.isNaN(‘Hello’);
To evaluate conditions “&&” “if” its true then the condition if block will be executed. False the else statement will be executed. With “||” if both are true the code inside the if statement will be executed.
Sources: https://www.w3schools.com/jsref/jsref_if.asp#:~:text=Use%20if%20to%20specify%20a,the%20first%20condition%20is%20falsehttps://www.w3schools.com/jsref/jsref_isnan.asp#:~:text=isNaN()%20returns%20true%20if,a%20number%20before%20testing%20it.
test
I like how you were able to provide the two links to better describe isNAN and what if/else statements are. Then you showed their syntax yourself.