Essentially I require:
if( [1,2].contains(2) ) {...}
I am surprised that I can't find a simple solution to this.
Is it possible to add a contains
method to JavaScript's List type?
Underscore's similar functions: _.contains vs. _.some and _.map vs _.each offers:
_.contains([1,2], 2);
However, _ is JQuery, and it is still rather clumsy.