Javascript Array indexOf(e)

Description

Javascript Array indexOf(e)

Array.prototype.indexOf = function (e) {
    for (var i = 0, j; j = this[i]; i++) {
        if (j == e) { return i; }
    }/*ww w . java 2s. com*/
    return -1;
}



PreviousNext

Related