国产精品黄页网在线观看,欧美日韩国产综合新一区,国产欧美高清精品一区2,久久国产乱子伦免电影

隨機(jī)生成數(shù)字,random()方法得使用

程序猿 2021-03-13 16:35:00 2289瀏覽 加載中

返回介于0(包含)~1(包含)之間的一個(gè)隨機(jī)數(shù)

Math.random()

返回介于1(包含)~10(包含)之間的一個(gè)隨機(jī)數(shù)

Math.floor((Math.random()*10)+1);

返回介于min(包含)~max(包含)之間的一個(gè)隨機(jī)數(shù)

function getRndInteger(min, max) {
  return Math.floor(Math.random() * (max - min) ) + min;}


標(biāo)簽:
最后修改:2025-10-30 09:09:53

非特殊說明,本博所有文章均為博主原創(chuàng)。