Remove by value - Node.js Array

Node.js examples for Array:Remove Element

Description

Remove by value

Demo Code

define( function() {

    Array.prototype.remove = function( v ) {
        for ( var i = this.length; i--; ) {
            if ( this[ i ] === v ) this.splice( i, 1 );
        }/*  w  w w . j av a 2s .  c  om*/
        return this;
    };

} );

Related Tutorials