Do you know what will be the output of this code?
JavaScript
const { a, ...rest } = { a: 1, b: 2, c: 3 };
console.log(rest);
Show answer and explanation
The answer is { b: 2, c: 3 }.
...rest gathers every property that wasn’t destructured into a new object. It’s a common way to copy an object without one key.