Node.js examples for Array:Array Value
Check if a value exists in an array
Array.prototype.exist = function(el) { for (var i = 0; i < this.length; i++) if (this[i] == el) return i;/*from ww w .java 2 s.c om*/ return -1; };