es6-destructuring Flashcards
1
Q
What is destructuring, conceptually?
A
Taking the values within the object and assign it to a variable
2
Q
What is the syntax for Object destructuring?
A
let {
property1: variable1,
property2: variable2
} = object;
3
Q
What is the syntax for Array destructuring?
A
let [index1, index 2] = array
4
Q
Destructuring: variable name goes on the right of the assign operator ( let/const { } or [ ] = variable )
Creating: variable name goes on the left of the assign operator ( variable = { } or [ ])
A
Destructuring: variable name goes on the right of the assign operator ( let/const { } or [ ] = variable )
Creating: variable name goes on the left of the assign operator ( variable = { } or [ ])