es6-destructuring Flashcards
What is destructuring, conceptually?
to pull information from an array or object and store variable. shorthand for accessing values.
What is the syntax for Object destructuring?
keyword let , opening curly brace{, variable names if the property name and variable names are the same, or the property name as key and the variable names as values if using different names, closing curly brace }, and assignment operator, and the name of object.
What is the syntax for Array destructuring?
keyword let or const, [], with the variable names and assignment to the name of array.
How can you tell the difference between destructuring and creating Object/Array literals?
for destructuring, the assignment operator is after the object or array