0
I don't really understand the if and else statement, can someone pls explain cuz I'm lost
Number(document.getElementById("age").value); if (isNaN(age)) { voteable = "Input is not a number"; } else { voteable = (age < 18) ? "Too
2 odpowiedzi
+ 1
if you are beautifull
you have a lot of girls
else
you have none
// How simple is this ? ^^
0
isNaN will check if age value is a number or not.
NaN means Not a Number, you can see what qualify as NaN here ( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/NaN#Testing_against_NaN )
you can read it like this
if age is Not a Number