A set is an array with no repeated items. This data structure gives you a bit more control over your values than an array. In this video, discover how these are used.
- [Presenter] Sets are collections of values … that can be of any type, … but the rule with Sets is that each value must be unique. … The API of this is a little similar to Map, … but a little bit different as well. … So when we create a new set, … we're going to use the constructor and then we can make use … of some functions on the Sets prototype. … So the first thing we'll do here is we will add a book … to our set, "Pride and Prejudice." … And then let's go ahead and add "War and Peace" as well. … Once we've done this, … we can log books to our console. … And you'll see that this is not quite like a regular object. … It looks a little bit more like a map. … We see a couple different entries here … and both of these are on an index. … So zero and one. … We also have access to that dot size utility … and dot size is going to say that there are two books … in this set. … Another method that we can use is dot has. … So let's on line eight here, … check to see if our set has "Oliver Twist" in it. …
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.