I know that to declare more than one variable, there is a shortcut like var x=1,y=2,z=3.
Now, if I have an if statement where I test ONE variable, but for many values, like that:
if (x==1 || x==15 || x==25 || x==150){
}
Since the x is going to be something much longer in a real life example, I want to find a shortcut to enumerate all those values, one behind another, without writing the name of the variable every time)
How can I do it?
You could use inArray and do this (cross browser compatible)