I was just going through the MDN documentation for set , and how it works , coming to the part of how to iterate over a set , i saw the following examples:
// logs the items in the order: 1, "some text", {"a": 1, "b": 2}
for (let item of mySet) console.log(item);
And
// logs the items in the order: 1, "some text", {"a": 1, "b": 2}
for (let item of mySet.values()) console.log(item);
And
// logs the items in the order: 1, "some text", {"a": 1, "b": 2}
//(key and value are the same here)
for (let [key, value] of mySet.entries()) console.log(key);
Just to confirm , does this mean that when using set the keys and values are the same ?
Setwould contain key/value pairs how would it differ fromMapthen?