All Map posts

  • Removing Duplicates with Map In JavaScript

    Removing Duplicates with Map In JavaScript

    Updated on · 3 min read

    It is quite common to use Set to remove duplicate items from an array. A bit less-known fact is that Map data structure can also be used to filter out duplicates because it maintains key uniqueness, meaning that there can be no more than one key-value pair with the same key.


  • Simplifying Code with Maps In JavaScript

    Simplifying Code with Maps In JavaScript

    Updated on · 4 min read

    Map data structure is a relatively less known addition of ES6 to the language. It has a few advantages over objects when it comes to storing collections of key-value pairs. One of the interesting use cases is simplifications of React components that render different JSX based on state variables that are often changing.


Back to all posts