$ ./guess_the_languageProblem Solving — predict the output
Problem Solving — predict the output · medium · #110

What is the output?

console.log([1, 2, 3].fill(0, 1));
  1. [1, 0, 0]
  2. [0, 0, 0]
  3. [1, 2, 0]
  4. [0, 2, 3]
fill overwrites from the given start index to the end.
Play Problem Solving ▸