# Spot the bug - #53

**URL:** <https://forum.kirupa.com/t/spot-the-bug-53/682044>\
**Category:** web dev\
**Created:** [June 12, 2026, 7:00am UTC](https://forum.kirupa.com/t/spot-the-bug-53/682044 "2026-06-12T07:00:09Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![BobaMilk](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/bobamilk/32/31157_2.png) [@BobaMilk](https://forum.kirupa.com/u/BobaMilk)\
**Post date:** [June 12, 2026, 7:00am UTC](https://forum.kirupa.com/t/spot-the-bug-53/682044/1 "2026-06-12T07:00:09Z")

</div>

Find the bug in this animation loop.

```js
let x = 0;
function tick() {
  x + 2;
  requestAnimationFrame(tick);
}
tick();

```

Reply with what is broken and how you would fix it.

---

<div class="post-metadata">

**Author:** ![Quelly](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/quelly/32/31386_2.png) [@Quelly](https://forum.kirupa.com/u/Quelly)\
**Post date:** [June 13, 2026, 7:20am UTC](https://forum.kirupa.com/t/spot-the-bug-53/682044/2 "2026-06-13T07:20:25Z")

</div>

`x + 2;` is a no-op — you’re calculating a number and then immediately dropping it, so `x` never changes and the loop “runs” but nothing progresses.

Make it actually update state:

```auto
let x = 0;

function tick() {
  x += 2; // or x = x + 2
  requestAnimationFrame(tick);
}

tick();

```
