You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
806 B
21 lines
806 B
3 years ago
|
'use strict';
|
||
|
var $ = require('../internals/export');
|
||
|
var global = require('../internals/global');
|
||
|
var toIndexedObject = require('../internals/to-indexed-object');
|
||
|
var arraySlice = require('../internals/array-slice');
|
||
|
var arrayToSpliced = require('../internals/array-to-spliced');
|
||
|
var addToUnscopables = require('../internals/add-to-unscopables');
|
||
|
|
||
|
var Array = global.Array;
|
||
|
|
||
|
// `Array.prototype.toSpliced` method
|
||
|
// https://tc39.es/proposal-change-array-by-copy/#sec-array.prototype.toSpliced
|
||
|
$({ target: 'Array', proto: true, forced: true }, {
|
||
|
// eslint-disable-next-line no-unused-vars -- required for .length
|
||
|
toSpliced: function toSpliced(start, deleteCount /* , ...items */) {
|
||
|
return arrayToSpliced(toIndexedObject(this), Array, arraySlice(arguments));
|
||
|
}
|
||
|
});
|
||
|
|
||
|
addToUnscopables('toSpliced');
|