Appearance
从数组中获取 n 个随机元素。
import { sampleSize } from '@base-web-kits/base-tools-ts'; sampleSize([1, 2, 3], 2); // 结果: [3, 1] (随机)
collection (Array)
n (number)
(Array)