mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-05 17:37:50 +00:00
Use Array.isArray.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user