I'm trying to use console.log to see the properties of a Set object (like size). But if I try to log the keys in a Set, I get an empty array:
let mySet = new Set();
mySet.add(1);
mySet.add(2);
mySet.add(3);
let keys = Object.keys(mySet);
console.log(keys);
// Output: []
The same thing happens when I use a Map:
let myMap = new Map();
myMap.set('1', 1);
myMap.set('2', 2);
myMap.set('3', 3);
let keys = Object.keys(myMap);
console.log(keys);
// Output: []
Sethave?