Workshop › Tower Defense › Step 24 of 42
Every enemy killed this frame is worth 5 gold, which pays for the next tower; then the dead are removed.
```js
for (const e of enemies) if (e.hp <= 0) gold += 5
enemies = enemies.filter((e) => e.hp > 0)
```At the end of update, after an empty line, write the two lines.
Skills: Game states