InArray function for Javascript

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;
};

Please Share us:
Please rate this snippet

3 thoughts on “InArray function for Javascript

Leave a Reply