📜  随机坐标 js - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:02:44.505000             🧑  作者: Mango

代码示例1
function getRandomInRange(from, to, fixed) {
    return (Math.random() * (to - from) + from).toFixed(fixed) * 1;
    // .toFixed() returns string, so ' * 1' is a trick to convert to number
}