0
All results return"Youre too old" Why is that?
var firstName =prompt("Enter number of letters first name"); var secondName =prompt("Enter number of letters in second name"); var totalNum = (firstName + secondName ); if (totalNum > 30) { alert('Youre very old'); } else { alert('Youre very young'); }
2 Respostas
+ 3
You need to use the function parseInt on your input.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/parseInt
+ 1
HonFu 😂 finally got it. Thanks alot