-
simple javascript question
Hi guys, quick question
in my scripts I use a lot of statements with logical operators (this “OR” this):
var b = "b"if(b == "a" || b == "b"){
alert("I am a 'b'")
}else{("I am not a 'b'");
}
//result is "I am a 'b'"
Now, I was trying to do the same “OR” statement but with a != operator and it does not work… how do you do a if statement with OR operator when using !=
//this does not seem to work
var b = "b"if(b != "a" || b != "b"){
alert("I am a 'b'")
}else{ alert("I am not a 'b'");
}
//result is also "I am a 'b'
Thanks for helping me clarifying this!
Fabio