📅  最后修改于: 2022-03-11 15:01:38.895000             🧑  作者: Mango
const random = Math.random();
const randomMultiple = random * 10;
console.log(randomMultiple)
const randomFloor = Math.floor(randomMultiple);
console.log(randomFloor);
const randomCeil = Math.ceil(randomMultiple);
console.log(randomCeil)
const randomRound = Math.round(randomMultiple)
console.log(randomRound)
//Output:
// 2.545754647061882 randomMultiple
// 2 randomFloor
// 3 randomCeil
// 3 randomRound