ES6 Destructuring Flashcards

1
Q

What is destructuring, conceptually?

A

taking values out of an object/array and assigning them to a variable

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: var1, property2: Var2, …etc ) = Object. (if the var and title match you can do: const {property, property2, …. etc) = object.

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 [var 1, var2, var 3,…. etc] = Array

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

Arrays have [], Objects have {};

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