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,6 +1,5 @@
import arrayShuffle from './_arrayShuffle.js';
import baseShuffle from './_baseShuffle.js';
import isArray from './isArray.js';
/**
* Creates an array of shuffled values, using a version of the
@@ -17,7 +16,7 @@ import isArray from './isArray.js';
* // => [4, 1, 3, 2]
*/
function shuffle(collection) {
const func = isArray(collection) ? arrayShuffle : baseShuffle;
const func = Array.isArray(collection) ? arrayShuffle : baseShuffle;
return func(collection);
}