According to Mozilla
Object vs Map in JavaScript in short way with examples.
Object- follows the same concept as that of map i.e. using key-value pair for storing data. But there are slight differences which makes map a better performer in certain situations.
Map- is a data structure which helps in storing the data in the form of pairs. The pair consists of a unique key and a value mapped to the key. It helps prevent duplicity.
Key differences
var map = new Map();_x000D_
var obj = new Object(); _x000D_
console.log(obj instanceof Map); // false_x000D_
console.log(map instanceof Object); // true
_x000D_
var map = new Map();//Empty _x000D_
map.set(1,'1');_x000D_
map.set('one', 1);_x000D_
map.set('{}', {name:'Hello world'});_x000D_
map.set(12.3, 12.3)_x000D_
map.set([12],[12345])_x000D_
_x000D_
for(let [key,value] of map.entries())_x000D_
console.log(key+'---'+value)
_x000D_
let obj ={_x000D_
1:'1',_x000D_
'one':1,_x000D_
'{}': {name:'Hello world'},_x000D_
12.3:12.3,_x000D_
[12]:[100]_x000D_
}_x000D_
console.log(obj)
_x000D_