What is the correct fix?
const ids: number[] = [];
ids.push("3");
- Change
number[]tostring[] - Push a number:
ids.push(3) - Use
ids.add(3) - Remove the type annotation
A
Play Problem Solving ▸
number[] can only hold numbers, so push 3 not "3".