2 ms·
That's actually object destructuring. Object spreading is where you “spread“ an object's keys and values into a new object literal: const foo = { x: 1, y: 2
by bfrydl 8y ago
That's actually object destructuring. Object spreading is where you “spread“ an object's keys and values into a new object literal:
const foo = { x: 1, y: 2 };
const bar = { ...foo, z: 3 }; // has x, y, and z