Why is this floating balloon animator speeding up out of control?
function floatBalloon(posY = 0) {
balloon.style.transform = `translateY(${posY}px)`;
if (posY < 300) {
requestAnimationFrame(floatBalloon(posY + 2));
}
}
Reply with what is broken and how you would fix it.