vendredi 6 mars 2015

Please help to find out why the code works in such manner (JavaScript)

i've been working on a primitive code and got the unexpected result.



var one = prompt("Enter the number", "4");
var age = parseInt(one);
if (age >= 14 || age <= 90) {
console.log("Correct");
} else {
console.log("Wrong")
}


When I put 100, for example, it says "Correct" instead of "Wrong".


Would you be so kind to answer why it works in such manner.


Aucun commentaire:

Enregistrer un commentaire