Expand description
A pattern binding or assignment node.
A Pattern Corresponds to the BindingPattern and the AssignmentPattern
nodes, each of which is used in different situations and have slightly different grammars.
For example, a variable declaration combined with a destructuring expression is a BindingPattern:
const obj = { a: 1, b: 2 };
const { a, b } = obj; // BindingPatternOn the other hand, a simple destructuring expression with already declared variables is called
an AssignmentPattern:
let a = 1;
let b = 3;
[a, b] = [b, a]; // AssignmentPatternStructs§
- Array
Pattern - An array binding or assignment pattern.
- Object
Pattern - An object binding or assignment pattern.
Enums§
- Array
Pattern Element - The different types of bindings that an array binding pattern may contain.
- Object
Pattern Element - The different types of bindings that an
ObjectPatternmay contain. - Pattern
- An object or array pattern binding or assignment.