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

Which fix removes the bug?

const arr = [1, 2, 3];
arr.push;
  1. Use arr.add(4) instead of push
  2. Change arr.push; to arr.push(4);
  3. Use arr += 4 to append the value
  4. Remove the semicolon after push
push must be called with parentheses and a value.
Play Problem Solving ▸