Remove one element from array by value - Node.js Array

Node.js examples for Array:Remove Element

Description

Remove one element from array by value

Demo Code

Array.prototype.removeOne = function (el) {
    var index = this.indexOf(el);
    if (index != -1) {
        this.splice(index, 1);/*  www . ja va2 s . c  om*/
        return true;
    }
};

Related Tutorials