자바스크립트(javascript)
[random/js] javascript random 난수 생성하기
개발자 고포고
2022. 11. 3. 10:24
반응형
[random/js] javascript random 난수 생성하기
function getRandomInt(min, max) {
min = Math.ceil(min);
max = Math.floor(max);
return Math.floor(Math.random() * (max - min) + min); // The maximum is exclusive and the minimum is inclusive
}
#random #랜덤 #rand #난수 #javascript
반응형