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

Which fix removes the bug?

let count: number;
console.log(count + 1);
  1. Initialise count first
  2. Type count as any
  3. Use a const instead
  4. Add a null check
The variable is declared but never assigned, so it is used before being definitely assigned.
Play Problem Solving ▸