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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is the syntax for Object destructuring?

A

const {property name: variable name} = object name you want to destruct

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly