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

What is the output?

const [a, , b] = [1, 2, 3];
console.log(a, b);
  1. 1 3
  2. 1 2
  3. 2 3
  4. 1 undefined
The empty slot in the pattern skips one element of the array.
Play Problem Solving ▸