Unlike an object, a map is a collection of key or value pairs that are in a specific order. This might be a reason to use a map. Learn how to write your own map objects and discover how they are different from traditional objects.
- [Instructor] The map object holds key value pairs. … So what's the difference between a map and an object? … In a map, any value, both objects and primitive values … may be used either as a key or a value. … So let's take a look at what these maps look like. … Here on line one, I'm going to say, … let course equals new map … and we'll call that map constructor. … Maps then have these methods on them called set … so we can set values. … So the key would be react … and the value would be description ui, … so that object. … So then we can say course.set jest, … and we'll give that one an object description as well. … Jest is all about testing. … So once I hit save on that, I want to console log it. … Let's console log first, the course, … then we'll console log course.react. … Now, if I try to run this in the browser, … we'll see the map being logged, … but course.react, we're not seeing anything there. … And that's because a map is different than an object, … so we can't access the keys with dot notation. …
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.