This course will be retired on October 31, 2026.
Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Well done!
You have completed Introducing ES2015!
You have completed Introducing ES2015!
Preview
In this video we’ll look at the new Map object.
Code snippets
let stevenJ = { name: 'Steven', age: 22 },
sarah = { name: 'Sarah', age: 23 },
stevenS = { name: 'Steven', age: 22 };
Resources
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign upRelated Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
And to follow along using
the latest workspace, go ahead and
0:00
launch the workspace for this video.
0:01
In the file classroom-map.js,
I have a classroom, which is a Map object.
0:03
And like in the previous video, I'm
going to add students to the classroom.
0:09
So I'll create my students by pasting
in the student objects we used in
0:13
the previous video.
0:16
And you can also copy these from
the teacher's notes of this video.
0:17
So again, we have StevenJ,
Sarah, and StevenS.
0:20
So now, to add the three students to
the classroom, I'll use the set method.
0:25
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up