Array Destructuring
noun
say it: “uh-RAY dee-STRUK-chur-ing” /əˈreɪ diːˈstrʌktʃərɪŋ/
A JavaScript shortcut that copies items out of an array into variables by position in one line, such as const [first, second] = podium;
What is Array Destructuring in JavaScript?
Array Destructuring — Syntax that extracts array items by position into variables.
const coordinates = [40.0, -105.0];
const [latitude, longitude] = coordinates;
In a sentence
- “With array destructuring I named the top three scores gold, silver and bronze in one line.”
Level: Apprentice · More JavaScript terms at this level
Updated