Math.random()
回傳0~1(不包含1)的數字
Math.floor()
去除小數,取得整數
Math.floor(Math.random()*5);
取得0~4的隨機數字
- Mar 17 Sun 2019 23:25
-
隨機取得數字Math.random()
Math.random()
回傳0~1(不包含1)的數字
Math.floor()
去除小數,取得整數
Math.floor(Math.random()*5);
取得0~4的隨機數字
請先 登入 以發表留言。