js生成一个指定范围内的随机整数

function __random(start=0, end=1) {
  return Math.floor(Math.random() * (end - start + 1) + start);
}

console.log(__random(3,100));
posted @ 2018-11-06 23:02  aleng_liu  阅读(816)  评论(0编辑  收藏  举报