Code game ยท Debugging
Bug Hunt ๐
Each program below has exactly one bug. Read what the code should do, then click the line that breaks it.
Click the line with the bug.
Learn to debug like a professional
Developers spend more time reading and fixing code than writing it. Spotting a bug quickly is a real skill, and it comes from knowing the common mistakes. Bug Hunt trains you on the ones we see most often in real projects:
- Off-by-one errors: loops that run one time too many or too few.
- Wrong starting values: such as starting a maximum at 0.
- = vs ===: assigning when you meant to compare.
- Missing await: using a Promise as if it were the data.
- Object equality: two objects that look the same are not equal.
- Closures and this: var in loops, and functions that lose
this.
Each level is short and has exactly one bug, so you can practise in a few minutes a day.