]> git.r.bdr.sh - rbdr/dotfiles/blob
a8505a2ce2a201e73c174ab702f209477dabe29a
[rbdr/dotfiles] /
1 'use strict';
2
3 var isPlainArray = require('../../is-plain-array')
4
5 , isArray = Array.isArray, splice = Array.prototype.splice
6 , forEach = Array.prototype.forEach;
7
8 module.exports = function (start, deleteCount/*, …items*/) {
9 var arr = splice.apply(this, arguments), result;
10 if (!this || !isArray(this) || isPlainArray(this)) return arr;
11 result = new this.constructor(arr.length);
12 forEach.call(arr, function (val, i) { result[i] = val; });
13 return result;
14 };