jacktrades/array_lib — Issue #1: Use native implementations where possible
Author: jacktrades
Created: 2011-12-13 22:09:45+00:00
State: open

For instance the version of map in this library accepts multiple arrays. However in the single array case using the native implementation (if available) will provide significant speedup. Underscore.js uses this to test if there is a native implementation:

// Single array case
var nativemap = Array.prototype.map;
map = function (fn, array) {
if (nativemap && fn.map === nativemap) {
array.map(fn);
}
...
}