es6-destructuring-Q&A Flashcards
1
Q
What is destructuring, conceptually?
A
Destructuring broadly means extracting data from arrays or objects.
2
Q
What is the syntax for Object destructuring?
A
const { name, realName } = hero
3
Q
What is the syntax for Array destructuring?
A
const [book3, book4, book5] = library;
4
Q
How can you tell the difference between destructuring and creating Object/Array literals?
A
Array destructuring extracts values from an array. But object destructuring extracts values from a JavaScript object.