When coding in JavaScript, we have learned to use if/else statements. The reason we use these statements is to execute a block of code if one condition is true. That is it’s purpose. the if/else statement is considered a “Conditional” statement, meaning the different actions are performed based on the different conditions. The general syntax of if/else statements is as follows- if a condition is true, the “block of the statement” will be executed. However, if this is not the case, the “block of the statement” will either be skipped or jumped onto another “block of the statement”. You are not limited to the number of conditional statements you have within a particular code.
When looking at isNaN in JavaScript, the definition of this is “Not a Number”. The code statement is simply just used to check whether a value is a number or not. If the value is a number, JavaScript will return “true”, but if it is not a number, it will return “false”.
Below I have provided examples of both code statements
Paige,
I think that you did a good job explaining if/else statements as well as the NaN. I didn’t fully grasp what it was but you did a good job at simply explaining it and I am able to better understand it.