mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-07 18:07:49 +00:00
Remove arguments references where possible.
This commit is contained in:
13
concat.js
13
concat.js
@@ -24,18 +24,7 @@ import isArray from './isArray.js';
|
||||
* console.log(array);
|
||||
* // => [1]
|
||||
*/
|
||||
function concat() {
|
||||
const length = arguments.length;
|
||||
if (!length) {
|
||||
return [];
|
||||
}
|
||||
const args = Array(length - 1);
|
||||
const array = arguments[0];
|
||||
let index = length;
|
||||
|
||||
while (index--) {
|
||||
args[index - 1] = arguments[index];
|
||||
}
|
||||
function concat(array, ...values) {
|
||||
return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user