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);
pull values out of objects and arrays