April 2018
Intermediate to advanced
284 pages
5h 46m
English
| Tip 13 | Update Key-Value Data Clearly with Maps |
In this tip, you’ll learn how to use the Map object for key-value collections of frequently updated data.
In Tip 10, Use Objects for Static Key-Value Lookups , you learned that you should only use objects deliberately and not as a default collection. Now you’re going to get a chance to look at an alternative: Map.
Map is a special kind of collection that can do certain things very easily. The Mozilla Developer Network has a nice list of circumstances where Map is a better option for a collection than a plain object.[13] I encourage you to read the full list, but this tip examines two specific situations:
In the next tip, you’ll ...
Read now
Unlock full access