$ ./guess_the_languageProblem Solving — fix the bug
Problem Solving — fix the bug · easy · #13

Which fix removes the bug?

let count = 0;
while (count < 3) {
  console.log(count);
}
  1. Add count++ inside the loop
  2. Change < to <= in the test
  3. Start count at 1 instead of 0
  4. Use a for loop header instead
Without incrementing count, the loop never ends.
Play Problem Solving ▸