Destructuring Flashcards
1
Q
What is destructuring, conceptually?
A
process of breaking a structure.
where we break down objects and arrays to their small components
2
Q
What is the syntax for Object destructuring?
A
const {variable names in order} = objectName;
3
Q
What is the syntax for Array destructuring?
A
const [array variable names] = arrayName;
4
Q
How can you tell the difference between destructuring and creating Object/Array literals?
A
creating object and array literals has the object/ array name first right after the const let or var
while destructuring has it at the end before the ;