Underscore shuffle sample toArray size partition

_.shuffle()

返回随机乱序的副本


_.sample()

_.sample(list, [n])

产生一个随机样本,[n]返回随机的元素,否则返回单一的随机项

Underscore shuffle sample toArray size partition

_.toArray()

_.roArray(list);

把任何一个迭代的对象转换成一个数组,转换arguments对象时非常有用

Underscore shuffle sample toArray size partition


_.size()

_.size(list)返回list的长度 

Underscore shuffle sample toArray size partition

_.partition()

_.partition(list, pre) 把一个数组拆分为俩个,第一个都满足pre迭代器,第二个不满足.

Underscore shuffle sample toArray size partition


你可能感兴趣的:(Underscore shuffle sample toArray size partition)