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

Which fix removes the bug?

const n = '7';
if (n === 7) {
  run();
}
  1. Convert first: Number(n) === 7 in the test
  2. Convert first: String(n) === 7 in the test
  3. Change const n to let n before the test
  4. Compare the value against '7' with ==
Strict equality never matches across types; convert the string to a number.
Play Problem Solving ▸