Remove element from array - Node.js Array

Node.js examples for Array:Remove Element

Description

Remove element from array

Demo Code


Array.prototype.remove = function(s) {
    var i = this.indexOf(s);
    if(i != -1) {
        this.splice(i, 1);/*from   w  w  w  .  ja va  2  s .c om*/
    }
}

Related Tutorials