-
카테고리
-
세부 분야
프로그래밍 언어
-
해결 여부
미해결
lotto에서 함수화 부분에서요!!
21.08.10 10:02 작성 조회수 141
0
제로초님!! 안녕하세요! 좋은 강의 항상 잘 듣고 있습니다.
다름이 아니라
저는 function에 setTimeout도 반복된다고 생각해서 같이 넣었는데 혹시 setTimeout을 함수에 넣었을 때 성능 저하나 다른 이유가 있어서 function만드실 때 따로 빼신 이유가 있을까요??
function view(component, index, time) {
setTimeout(() => {
const $ball = document.createElement("div");
$ball.setAttribute("class", "ball");
$ball.textContent = `${winBalls[index]}`;
component.appendChild($ball);
}, time);
}
답변을 작성해보세요.
0
답변 1