Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我是 javascript 新手,我需要帮助来实现一个简单的函数,该函数生成一个仅由 2 位数字组成的随机正数。任何人都可以帮助我吗?
对于 10 到 99 之间的随机数,请使用:
Math.floor(Math.random() * 90 + 10)
jsFiddle 演示:http: //jsfiddle.net/zjLY6/
尝试
Math.random().toFixed(2)*100