Destructuring
Definition
A syntax for extracting values from arrays or properties from objects into distinct variables. Destructuring simplifies code and is commonly used in function parameters, imports, and React hooks.
Code Example
Javascript
Tip: Modify the code above and click “Run” to see the results
Learn More
Related Terms
Spread Operator
The ... syntax that expands an iterable (array, string, object) into individual elements. Used for copying arrays/objects, merging, and passing multiple arguments to functions.
Rest ParametersThe ... syntax used in function parameters to collect all remaining arguments into an array. Unlike the arguments object, rest parameters produce a real array.