Destructuring and spread

Destructuring extracts values from an object or array into variables in a single statement. The spread operator ... spreads the elements of an iterable or the properties of an object, and rest (...reste) gathers them. They simplify copies, merges, and parameters.

Example

const { nom, age } = user
const [premier, ...autres] = liste
const tous = [...a, ...b]

Related concepts

The whole glossary