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

Which fix removes the bug?

setTimeout(refresh(), 1000);
  1. Pass refresh without calling
  2. Pass 1000 as the first argument
  3. Wrap refresh in Promise
  4. Replace it with setInterval
refresh() runs immediately and its return value is scheduled instead.
Play Problem Solving ▸