toFixed (x) 小數點後面太多,想要顯示前x 位小數點就好,傳回來是字串,不傳 ... console.log(Math.floor(Math.random()*10+1)) // 取1 ~ 10 的整數.
確定! 回上一頁