Is this simply to shorten the lookup chain?
var slice = Array.prototype.slice;
var splice = Array.prototype.splice;
http://backbonejs.org/docs/backbone.html
jQuery does something similar:
core_push = Array.prototype.push,
core_slice = Array.prototype.slice,
For Backbone, that makes no sense at all. Both
sliceandspliceare used exactly once, thus thevardeclarations crate unnecessary overhead.For jQuery, different story. A local reference of something that is referenced numerous times, facilitates minification. So the code size of the production version decreases.
Yes, it’s a minor performance gain too, but nothing worth talking about.