Tin mới
JavaScript: Scripting language
Web APIs: Programming interfaces
Structuring content with HTML module
Dynamic scripting with JavaScript module
Note: The parentheses ( ... ) around the assignment statement are required when using object literal destructuring without a declaration.
For both object and array destructuring, there are two kinds of destructuring patterns: binding pattern and assignment pattern, with slightly different syntaxes.
In an array destructuring from an array of length N specified on the right-hand side of the assignment, if the number of variables specified on the left-hand side of the assignment is greater than N, only the first N var
In an array destructuring from an array of length N specified on the right-hand side of the assignment, if the number of variables specified on the left-hand side of the assignment is greater than N, only the first N var
Default parameters > Destructured parameter with default value assignment
A property can be unpacked from an object and assigned to a variable with a different name than the object property.
A property can be unpacked from an object and assigned to a variable with a different name than the object property.
A property can be unpacked from an object and assigned to a variable with a different name than the object property.
Object destructuring is almost equivalent to property accessing. This means if you try to destruct a primitive value, the value will get wrapped into the corresponding wrapper object and the property is accessed on the w
Destructuring primitive values
Object destructuring is almost equivalent to property accessing. This means if you try to destruct a primitive value, the value will get wrapped into the corresponding wrapper object and the property is accessed on the w
This page was last modified on Aug 10, 2026 by MDN contributors.