Q:

Shorten Conditional Statement? 

Fairly simple question, not sure what I'm missing here...
I have something like this: 
if(this == 18 || this == 19 || this == 20 || this == 21) { 
    ...
}

How can I shorten it?  I've tried if(this == 18 || 19 || 20...) but that didn't work.  I have about 50 more of those values to go so it would be great if I could.  
Thanls. 

A:

Assuming a suitable shim for older browsers:
if( [18,19,20,21].indexOf(this) > -1) {

Or, alternatively:
if( "|"+[18,19,20,21].join("|")+"|".indexOf("|"+this+"|") > -1) {

