Question PRG-JS-0067
HardWhat is the output of this program?
const arr = [1, 2, 3, 4];
const [first, , third, ...rest] = arr;
const { a = 10, b: renamed = 20 } = { b: 5 };
console.log(first, third, rest, a, renamed);
- A.
1 3 4 undefined 5
- B.
1 3 [ 4 ] 10 20
- C.
Sign up free to see the answer and a step-by-step explanation.