js 实现从1-103中随机抽取多个数,返回一个数组

发布于:2023-04-02 ⋅ 阅读:(548) ⋅ 点赞:(0)
function getNum(min,max,count){
  let arr = [];
  for (let i = 0; i < count; i++) {
    arr[i] = (Math.ceil(Math.random()*max));
  }
  return arr;
};
getNum(1,103,10);
console.log(getNum(1,103,10));