short hand for chaining logical operators in javascript?
- by Travis
Is there a better way to write the following conditional in javascript?
if ( value == 1 || value == 16 || value =-500 || value = 42.42 || value == 'something' ) {
// blah blah blah
}
I hate having all of those logical ORs strung together. I'm wondering if there is some kind of shorthand.
Thanks!