Return to Snippet

Revision: 58221
at July 2, 2012 18:03 by agarcim


Initial Code
Array.prototype.remove = function(e) {
    var t, _ref;
    if ((t = this.indexOf(e)) > -1) {
        return ([].splice.apply(this, [t, t - t + 1].concat(_ref = [])), _ref);
    }
};

Initial URL
http://stackoverflow.com/questions/4825812/clean-way-to-remove-element-from-javascript-array-with-jquery-coffeescript

Initial Description
Remove the item from the array changing the length of the array.

Initial Title
Remove item from array

Initial Tags
javascript

Initial Language
JavaScript