// Math.random()// 默认情况下,生成的随机数是 0,1,包括0,不包括1// 生成1-10Math.floor(Math.random() * 10 + 1)// 生成 a-b 之间的数Math.floor(Math.random() * (b - a) + a)
function random() {let arr = [];while (arr.length < 10) {arr.push(Math.floor(Math.random() * (100-10) + 10))}return arr.sort()}console.log(random());
