Use Array.isArray.

This commit is contained in:
John-David Dalton
2017-01-09 18:44:38 -08:00
parent 395a81058b
commit 68190b8546
31 changed files with 34 additions and 64 deletions

View File

@@ -1,7 +1,6 @@
import arrayPush from './_arrayPush.js';
import baseFlatten from './_baseFlatten.js';
import copyArray from './_copyArray.js';
import isArray from './isArray.js';
/**
* Creates a new array concatenating `array` with any additional arrays
@@ -25,7 +24,7 @@ import isArray from './isArray.js';
* // => [1]
*/
function concat(array, ...values) {
return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1));
return arrayPush(Array.isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1));
}
export default concat;