を選択します.


繰り返し文の無効化

/*var lotto = [];
lotto.push(parseInt(Math.random() * 45 + 1));
lotto.push(parseInt(Math.random() * 45 + 1));
lotto.push(parseInt(Math.random() * 45 + 1));
lotto.push(parseInt(Math.random() * 45 + 1));
lotto.push(parseInt(Math.random() * 45 + 1));
lotto.push(parseInt(Math.random() * 45 + 1));
document.write(lotto);

文の複文

for (시작;; 증가) {
    반복할문장
}
for (var i = 0; i < 6; i++){ 
    document.write(i); 
}

繰り返し文の使用

var lotto = [];
for (var i = 0; i < 6; i++) {
    lotto.push(parseInt(Math.random() * 45 + 1));
}
document.write(lotto);