JavaScript Map
You should use JavaScript Map when an object consists of ==key: value
pairs and you frequently add and delete entries== (action performed).
Object to Map and vice versa
Advantages over JavaScript Objects
- Objects return
true
even if they’re empty, which is wat behaviour.Map
s are alwaysfalse
when empty. - Maps will preserve order of keys