48
rated 0 times
[
50]
[
2]
/ answers: 1 / hits: 62253
/ 7 Years ago, tue, august 8, 2017, 12:00:00
I'm using repl.it/languages/javascript.
Do I have to convert it to an object before I print it out?
I've tried
const mapObject = new Map();
mapObject.set(1, 'hello');
console.log(JSON.stringify(mapObject));
console.log(mapObject);
The results are always empty object.
When I use
console.log([...mapObject]);
It prints out an array format.
More From » dictionary