es6 destructuring Flashcards

1
Q

What is destructuring, conceptually?

A

A different way of declaring and assigning properties and elements of objects and arrays to 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

{ prop1: var1, prop2: var2, , prop4: var4 = default} = 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

[ var1, , var3] = 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

The object or array name is on the right of the =

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