Object Destructuring
noun
say it: “OB-jekt dee-STRUK-chur-ing” /ˈɒbdʒɛkt diːˈstrʌktʃərɪŋ/
A JavaScript shortcut that copies several properties out of an object into variables of the same names in one line, such as const { name, species } = pet;
What is Object Destructuring in JavaScript?
Object Destructuring — Syntax that extracts named object properties into variables.
const order = { item: "tea", quantity: 2 };
const { item, quantity } = order;
In a sentence
- “Object destructuring gave me name and species variables from the pet in one line.”
Level: Apprentice · More JavaScript terms at this level
Updated