UNPKG

327 BJavaScriptView Raw
1'use strict';
2var arraySpeciesConstructor = require('../internals/array-species-constructor');
3
4// `ArraySpeciesCreate` abstract operation
5// https://tc39.es/ecma262/#sec-arrayspeciescreate
6module.exports = function (originalArray, length) {
7 return new (arraySpeciesConstructor(originalArray))(length === 0 ? 0 : length);
8};