es6-destructuring Flashcards
1
Q
What is destructuring, conceptually?
A
allows you to destructure properties of an object or elements of an array into individual variables.
2
Q
What is the syntax for Object destructuring?
A
let //or const {
property1: variable1, // property key
property2: variable2
} = object;
3
Q
What is the syntax for Array destructuring?
A
variable keyword [ var ] = arrayName
4
Q
How can you tell the difference between destructuring and creating Object/Array literals?
A
var name on the right (destructuring)
on the left (creating Obj)