This snippet will give you the InArray function for Javascript.

Sample Javascript

Array.prototype.InArray = function (input) {
	var i;
	for (i=0; i < this.length; i++) {
		if (this[i] === input) {
			return true;
		}
	}
	return false;
};

3 thought on “InArray function for Javascript”

Leave a Reply