Basically, in JavaScript, every object is a hashmap that will accept strings or a symbol as a key. You can use the below code snippet to implement it:
var map = {};
// add a item
map[key1] = value1;
// or remove it
delete map[key1];
// or determine whether a key exists
key1 in map;
I hope this will help.
Want to know more about Java? Prefer this tutorial on Learn Java.
Want to become a Java Expert? Join Java Training now!!