es6-destructuring Flashcards

1
Q

What is destructuring, conceptually?

A

destructuring assigns properties of an object or elements of an array to individual 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 or let {
propName,
PropName2,
PropName3
} = objectName;
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 [,,,prop4] = arrayName

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 assignement operator comes at the end for destructuring

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