es6-destructuring Flashcards
1
Q
What is destructuring, conceptually?
A
destructuring assigns properties of an object or elements of an array to individual variables
2
Q
What is the syntax for Object destructuring?
A
const or let { propName, PropName2, PropName3 } = objectName;
3
Q
What is the syntax for Array destructuring?
A
const [,,,prop4] = arrayName
4
Q
How can you tell the difference between destructuring and creating Object/Array literals?
A
the assignement operator comes at the end for destructuring