Node.js examples for Array:Remove Element
Removes the passed item from an array, the opposite of push().
Array.prototype.pull = function (item) { var index = this.indexOf(item); if (index > -1) { this.splice(index, 1);/* w w w . j a v a2 s . co m*/ return index; } else { return -1; } };