Join Carl Peaslee for an in-depth discussion in this video Destructuring assignments, part of React: ES6, ES2016, and Beyond.
- [Instructor] In this video we're going to talk…about Destructuring Assignments.…Now Destructuring Assignments don't really offer us…any new features, but rather they enable us…to write more readable and less repetitive code.…So have you ever had a function that was dealing…with these enormous deeply nested objects…and it felt like your code was kind of…sprawling out of control, it was getting hard to read?…Well that's what destructuring assignments…help us deal with.…Let's open up the destructuring.js file…inside of examples, and we'll run through a few examples.…So I've got this object that I've declared…called feast and we're going to destructure it.…
I can commit these out and you can see how…I can declare a let and name a key value pair…within the feast object,…and then below that, I can access that appetizer…or that dessert, those key value pairs,…as its own variable.…So rather than having to say console.log(feast.appetizer)…or feast.dessert, I can just get right at…the key value pair that I want to access.…
- Using const and let
- Importing and exporting modules
- Arrow functions
- Destructing assignments
- Arguments and template literals
- Extended parameter handling with the spread operator
- Generating custom styles
- Classes, getters and setters
Skill Level Intermediate
1. Variables and Declarations
2. Arguments and Template Literals
4. Promises and Async
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
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.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.