Date

“Collection” Methods

_.shuffle(collection)

source npm package

Creates an array of shuffled values, using a version of the Fisher-Yates shuffle.

引入版本

0.1.0

参数
collection (Array|Object) : The collection to shuffle.

返回值
(Array) : Returns the new shuffled array.

示例
_.shuffle([1, 2, 3, 4]);
// => [4, 1, 3, 2]