Whatever you do, don't do this.
Map.prototype.toJSON = function() {
return Object.fromEntries(this);
};
const map = new Map();
map.set('a', 1);
map.set('b', { datum: true });
map.set(false, [1, 2, 3]);
map.set('d', new Map([['e', true]]) );
const json = JSON.stringify(map);
console.log(json);