Underscore wrap(), , Underscore Backbone. wrap(), , :
Backbone.Collection.prototype.remove = _.wrap(
Backbone.Collection.prototype.remove,
function(original_remove, models, options) {
var original_args = Array.prototype.splice.call(arguments, 0, 1);
console.log('removing');
original_remove.apply(this, original_args);
this.trigger('removed', models);
});
- Array.prototype.splice, ( Underscore ). apply() , , call(), , .
Array.prototype.splice, arguments.splice(), , arguments Javascript Array .