Learn how to use destructuring to assign object properties to independent variables or other object properties.
- [Instructor] Destructuring objects is…a bit different than arrays.…While the concept is the same,…there are some key differences.…But first let's look at assigning from…object properties in ES5.…With ES5, you would use dot or bracket notation…to individually assign object properties to variables.…It's not quite as redundant as assigning from arrays,…but there's still a bit of unnecessary code involved.…With destructuring, we get rid of the redundant…references to properties on the object…and use the object literal syntax on the left hand side…to destructure the object.…
The variables are assigned not by the order of the property…but by the object property key.…In this example, you can see that the variable names…I'm using match exactly to the property keys in the object.…This is how variables and destructured object…properties are assigned.…You can also customize this, in case you want to have…different variable identifiers, by adopting an object…property-like syntax when destructuring.…The key would be the property key from the right hand side…
- Using arrow functions
- Using default parameters
- Reviewing the class structure in ES6
- Assigning variables with let and const
- Array destructuring and object destructuring
- Replacing callbacks with promises
- Keeping values unique with Set
- Dropping the prototype with Map
- Working with generators
- Using yield with arguments
Skill Level Intermediate
Building a Website with Node.js and Express.jswith Ray Villalobos3h 16m Intermediate
Node.js: Test-Driven Developmentwith Alexander Zanfir33m 13s Intermediate
Learning NPM the Node Package Managerwith Ray Villalobos35m 10s Intermediate
Building a Web Interface with React.jswith Ray Villalobos1h 21m Intermediate
3. Promises and Collections
4. Iterators and Generators
Next steps1m 41s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.