課程
/前端開發(fā)
/JavaScript
/JavaScript進(jìn)階篇
不是很懂這個(gè)話,意思是返回一個(gè)不大于10的數(shù)?是用round(random*10)再減1嗎?
2016-10-04
源自:JavaScript進(jìn)階篇 7-16
正在回答
1-10都算是不大于10 的整數(shù)吧
劉毅毅 提問者
document.write(Math.round(10*Math.random()));
舉報(bào)
本課程從如何插入JS代碼開始,帶您進(jìn)入網(wǎng)頁(yè)動(dòng)態(tài)交互世界
4 回答計(jì)算不大于10的整數(shù)?負(fù)數(shù)算嗎?
1 回答使用random()和round()計(jì)算不大于10的整數(shù)
1 回答使用random ()方法和round(),計(jì)算不大于10的整數(shù)
2 回答為什么不能計(jì)算小數(shù)呢?
1 回答怎么不能計(jì)算小數(shù)
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號(hào)-11 京公網(wǎng)安備11010802030151號(hào)
購(gòu)課補(bǔ)貼聯(lián)系客服咨詢優(yōu)惠詳情
慕課網(wǎng)APP您的移動(dòng)學(xué)習(xí)伙伴
掃描二維碼關(guān)注慕課網(wǎng)微信公眾號(hào)
2016-10-04
1-10都算是不大于10 的整數(shù)吧
2016-10-04
document.write(Math.round(10*Math.random()));