The purpose of the if/else code in JavaScript is to execute a block of code if a specified condition is true, and execute another one if the condition is false. IsNaN is short for “not a number”. The isNaN() code returns true if a value is not a number.
Link to image: https://javascript.plainenglish.io/6-tips-to-improve-your-conditional-statements-for-better-readability-56256c5a5245
Beckett Houck says
I’m glad you included the isNaN() code is your response, as that is very important when dealing with if/else statements.
Madison Gordon says
IsNaN was something that I don’t fully understand still. However the image of the if/else statement is a perfect example because that is basically all you need to run it. If you use that template, you could make an if/else for whatever you want.