array.prototype.splice
Version:
An ES5 spec-compliant `Array.prototype.splice` shim/polyfill/replacement that works as far down as ES3.
17 lines (12 loc) • 339 B
JavaScript
;
var define = require('define-properties');
var getPolyfill = require('./polyfill');
module.exports = function shimArrayPrototypeSplice() {
var polyfill = getPolyfill();
define(
Array.prototype,
{ splice: polyfill },
{ splice: function () { return Array.prototype.splice !== polyfill; } }
);
return polyfill;
};