Fundamentals12 / 12
Up next

Destructuring

const point = { x: 1, y: 2 };
// name the fields you want
const { x, y } = point;
// rest gathers the remaining elements
const [first, ...others] = [10, 20, 30, 40];
console.log(x, y, first, others);
What you're solving

pull values out of objects and arrays