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

What is the correct fix?

const ids: number[] = [];
ids.push("3");
  1. Change number[] to string[]
  2. Push a number: ids.push(3)
  3. Use ids.add(3)
  4. Remove the type annotation
A number[] can only hold numbers, so push 3 not "3".
Play Problem Solving ▸