js 可以使用Math(算数) 对象来实现随机数的生成。 需要了解的Math 对象方法方法 ... Math.ceil(Math.random()*10); // 获取从1 到10 的随机整数,取0 的概率极小。
確定! 回上一頁