Javascript Array isInArray(elem)

Description

Javascript Array isInArray(elem)


Array.prototype.isInArray = function (elem) {
    for (i = 0, len = this.length; i < len; i++) {
        if (this[i] == elem) {
            return true;
        }//from ww  w  . ja v  a2s . c  om
    }
    return false;
}



PreviousNext

Related