Javascript Array generateId()

Description

Javascript Array generateId()

Array.prototype.generateId = function() {
    var id = 0;/* w ww.  j  a  v  a 2 s  . com*/
    this.forEach(function(e) {
        if (e.id <= id)
            id++;
    });
    return id;
}



PreviousNext

Related