function selectFrom(lowerValue, upperValue) {
    var choices = upperValue - lowerValue + 1;
    return Math.floor(Math.random() * choices + lowerValue);
}
var num = selectFrom(2, 10);
alert(num);

 

相关文章:

  • 2022-01-16
  • 2021-10-18
  • 2022-12-23
  • 2021-12-18
  • 2022-01-28
猜你喜欢
  • 2021-09-27
  • 2021-07-21
  • 2021-11-05
  • 2022-12-23
  • 2021-06-10
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案