- [Instructor] The spread operator does a lot … of powerful things with three small dots. … The spread operator turns the elements of an array … into arguments of a function call … or into elements of an array literal. … Let's take a look at this. … I'm going to create an array of strings. … So we have some cats here. … And then I'll create another array of dogs. … Then I'm going to create an array of animals. … Smoky. … We have Miro the fish, and then we have Swimmy, a shark. … So if I wanted to add the cats and dogs to our animals list, … I might want to just add them here. … So I'll just comma-separate them, … and then I'll console.log the animals to see what we get. … But then immediately, we notice that we have our three items … from the original array, … but then we have two nested arrays in here, … which is really not what I was going for. … I want everything to be at the same level with no nesting. … Here's where the spread operator comes into play. … I can add three dots right in front of cats, …
This course was created by Eve Porcello. We are pleased to offer this training in our library.
- What is ECMAScript?
- Writing and searching strings
- Writing maps
- Destructuring arrays
- Searching arrays
- Creating objects
- Destructuring objects
- Iterating with the for/of loop
- Getting and setting class values
- Using ECMAScript functions
- Building and returning promises
- Using async/await syntax
Skill Level Intermediate
1. What Is ECMAScript?
What is ECMAScript?1m 44s
2. ECMAScript Variables and Data Structures
3. Arrays and Array Methods
Destructuring arrays1m 34s
4. ECMAScript Objects
5. ECMAScript Functions
- 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.