2015年3月9日
摘要: 之前写一款小卡牌游戏时, 写过从数组中随机抽取X个数的方法(X小于数组长度);然后学习了 underscore 的 “sample” 方法,知道了最简单的实现法:_.sample([1, 2, 3, 4, 5, 6]);=> 4_.sample([1, 2, 3, 4, 5, 6], 3);=>... 阅读全文
posted @ 2015-03-09 16:37 萧强 阅读(2523) 评论(1) 推荐(0) 编辑