📌  相关文章
📜  javascript 获取给定范围内的随机整数数组 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:02:16.662000             🧑  作者: Mango

代码示例4
const randomArrayInRange = (min, max, n) => Array.from({ length: n }, () => Math.floor(Math.random() * (max - min + 1)) + min);

// Example
randomArrayInRange(1, 100, 10);