$ ./guess_the_languageProblem Solving — fix the bug
Problem Solving — fix the bug · medium · #184

Which fix removes the bug?

if (config.retry.count) {
  schedule(config.retry);
}
  1. Use optional chaining
  2. Wrap it in a try block
  3. Compare count with 0
  4. Default config to null
Reading .count on a missing retry throws; config.retry?.count short-circuits instead.
Play Problem Solving ▸