Tuesday 22 May 2007

inArray()

This is just a simple function that extends the DOM Array object. It checks if a value is in Array()



Array.prototype.inArray = function (value) {
var c;
for (c=0;c < this.length; c++) {
if (this[c] === value) {
return true;
}
}
return false;
};

No comments: