function 프레밍마다실행할거() {
requestAnimationFrame(프레밍마다실행할거);
timer++;
ctx.clearRect(0, 0, canvas.width, canvas.height);
if (timer % 120 === 0) {
var cactus = new Cactus();
cactusArray.push(cactus);
}
cactusArray.forEach((a) => {
a.x--;
a.draw();
});
dino.draw();
}
굵게 표시한 부분이 궁금한데요, 프레임마다실행할거()함수 밖에 써도 동작하는데 문제는 없던데
안에 써주신 이유가있으실까요?ㅇㅅㅇ