Skip to content

Commit

Permalink
Update lotto.html
Browse files Browse the repository at this point in the history
  • Loading branch information
ZeroCho authored Jun 13, 2021
1 parent 6c119eb commit 44917f0
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions lotto.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,15 @@
console.log(winBalls, bonus);

const $result = document.querySelector('#result');

const drawBall = (number, $parent) => {
const $ball = document.createElement('div');
$ball.className = 'ball';
$ball.textContent = number;
$parent.appendChild($ball);
};
// [0, 1, 2, 3, 4, 5] -> [1000, 2000, 3000, 4000, 5000, 6000]

for (let i = 0; i < winBalls.length; i++) {
setTimeout(() => {
console.log(winBalls[i], i);
drawBall(winBalls[i], $result);
}, (i + 1) * 1000);
}
Expand Down

0 comments on commit 44917f0

Please sign in to comment.