es6-destructuring Flashcards

1
Q

What is destructuring, conceptually?

A

breaking an object into stored 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 {property1, property2, …} = 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 [element1, element2, …] = 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

Destructuring is a feature of JavaScript that allows you to extract values from arrays or objects and assign them to variables. It is typically used when you want to extract multiple values from an array or object and assign them to separate variables.

An object literal is a way to create an object in JavaScript by specifying its properties and values directly in code.

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