Maps are data structures that store key-value pairs. See how they work and learn about the ES6 map object.
💻 Code: http://codepen.io/beaucarnes/pen/jBjobG?editors=0012
🔗 Info: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map
🐦 Beau Carnes on Twitter: https://twitter.com/carnesbeau
⭐JavaScript Playlists⭐
▶JavaScript Basics: https://www.youtube.com/playlist?list=PLWKjhJtqVAbk2qRZtWSzCIN38JC_NdhW5
▶Data Structures and Algorithms: https://www.youtube.com/playlist?list=PLWKjhJtqVAbkso-IbgiiP48n-O-JQA9PJ
▶Design Patterns: https://www.youtube.com/playlist?list=PLWKjhJtqVAbnZtkAI3BqcYxKnfWn_C704
▶ES6: https://www.youtube.com/playlist?list=PLWKjhJtqVAbljtmmeS0c-CEl2LdE-eR_F
▶Clean Code: https://www.youtube.com/playlist?list=PLWKjhJtqVAbkK24EaPurzMq0-kw5U9pJh
–
We’re busy people who learn to code, then practice by building projects for nonprofits. Learn Full-stack JavaScript, build a portfolio, and get great references with our open source community.
Join our community at https://freecodecamp.com
Read great tech articles at https://medium.freecodecamp.com
source
Watch 2x speed but we about 40-50 videos a week.
Couldn't understand a single thing after watching it thrice. Rushing through the code without explaining anything. By far the worst explanation.
Man you are amazing at explaining this stuff
Your typing speed literally makes my head spin. I don't think I can even make my fingers moves that fast. You're an android, aren't you?
Correction @ 4:28
map.entries() – returns keys + entries
map.keys() – returns keys
This is entirely incorrect. A map is not a javascript object. You would not, for example, be able to use a function as a key in your implementation. This is a very naive and very wrong tutorial. You should take this video down.
So, the benefit of Map is that you can use key not only String or Symbol. But in your example you use Object as as collection to store key:value. It's wrong implementation. You need to use array as collection with item {key: key, value: value}
Maps are useful for practical programming and Competitive programming alike.
Hello, why do you make a size function (the one that returns the variable count), can't you just call the variable count directly?
don't myObj.count and myObj.size() return the same value?
Very good explanation. Thank you teacher.
There might be one issue. It is the count++ in set method.
If we add item with existing key, it should not increment the count.
My CA$ 0.02. 😉
These tutorials are excellent! The length is perfect and seeing a new concept or an old one in a different context is so useful. Thanks!
I am facing problems for using these new syntax of ES6… can't remember syntax at the time of programming… what to do?