function getRandomInt(min, max) {
return Math.floor(Math.random() * (max - min)) + min;
}
function getRandomIntInclusive(min, max) {
return Math.floor(Math.random() * (max - min + 1)) + min;
}
這兩個函數的區別是啥?
function getRandomInt(min, max) {
return Math.floor(Math.random() * (max - min)) + min;
}
function getRandomIntInclusive(min, max) {
return Math.floor(Math.random() * (max - min + 1)) + min;
}
這兩個函數的區別是啥?