Many of you may know this already, but I just figured it out and thought it was cool.
It's also possible that I'm misunderstanding what I'm seeing, but I don't think so.
Say you wanted to compare a variable against 3 possible values, something like:
var value = 1; var matchA = 2; var matchB = 3; var matchC = 4; if(value == matchA || value == matchB || value == matchC) { // Do something super cool! } You can write the same thing like this (I think...) var value = 1; var matchA = 2; var matchB = 3; var matchC = 4; if(value == matchA|matchB|matchC) { // Do something super cool! } Not a big deal, but in my case it cleaned up some code and is a bit more maintainable...I imagine you could also use the bitwise AND operator as well?...I'd like it if someone could confirm I have all this correct, I can't find much by googling and it could be that in my particular cases I'm seeing some other strange effect that makes the above seem possible.