I'm using repl.it/languages/javascript.
Do I have to convert it to an object before I print it out?
I've tried
The results are always empty object.
When I use
console.log([...mapObject]);
It prints out an array format.
there is a more simpler solution you can try.
const mapObject = new Map();
mapObject.set(1, 'hello');
console.log([...mapObject.entries()]);
// [[1, "hello"]]
console.log([...mapObject.keys()]);
// [1]
console.log([...mapObject.values()]);
// ["hello"]