es6-destructuring Flashcards
1
Q
What is destructuring, conceptually?
A
taking object and arrays and converting it into a smaller object, arrays, and even variables.
2
Q
What is the syntax for Object destructuring?
A
const {property name: variable name} = object name you want to destruct
3
Q
What is the syntax for Array destructuring?
A
const [variable names that we want to take out]= array name we want to destruct
4
Q
How can you tell the difference between destructuring and creating Object/Array literals?
A
If it is happening on the left (it is destructering) if it is on the right side it is defining.