es6-destructuring Flashcards

1
Q

What is destructuring, conceptually?

A

to pull information from an array or object and store variable. shorthand for accessing values.

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

keyword let , opening curly brace{, variable names if the property name and variable names are the same, or the property name as key and the variable names as values if using different names, closing curly brace }, and assignment operator, and the name of 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

keyword let or const, [], with the variable names and assignment to the name of 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

for destructuring, the assignment operator is after the object or array

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