Math.random();
const limit = 5;
Math.random() * limit;
const min = 5;
const max = 8;
min + Math.random() * (max - min);
// 소수 버전
const randomNumber = (min, max) => {
return min + Math.random() * (max - min);
};
// 정수 버전
const randomNumber = (min, max) => {
return Math.round(min + Math.random() * (max - min));
};