UNPKG

array.prototype.tospliced

Version:

An ESnext spec-compliant `Array.prototype.toSpliced` shim/polyfill/replacement that works as far down as ES3.

21 lines (14 loc) 415 B
'use strict'; var define = require('define-properties'); var shimUnscopables = require('es-shim-unscopables'); var getPolyfill = require('./polyfill'); module.exports = function shim() { var polyfill = getPolyfill(); define( Array.prototype, { toSpliced: polyfill }, { toSpliced: function () { return Array.prototype.toSpliced !== polyfill; } } ); shimUnscopables('toSpliced'); return polyfill; };