You can use the indexOf
method and "extend" the Array class with the method contains
like this:
Array.prototype.contains = function(element){
return this.indexOf(element) > -1;
};
with the following results:
["A", "B", "C"].contains("A")
equals true
["A", "B", "C"].contains("D")
equals false