mercredi 6 avril 2016

Can't check one variable in if

I have a one problem. This is code:

var z = "+"
if (z!="+" || z!="-" || z!="*" || z!="/" || z!="%") document.write("You must give me operator (+ - * / %)");
else
document.write("Yess!");

OUTPUT IS: You must give me operator (+ - * / %)

Why it doesn't work correctly? Thank's for help. :)

Aucun commentaire:

Enregistrer un commentaire