entriesintermediateconst s = new Set(['a', 'b'])
for (const [key, val] of s.entries()) {
console.log(key, val) // 'a' 'a', then 'b' 'b'
}Use Set.entries() to iterate over [value, value] pairs; both elements are the same.
For Set, entries() yields [value, value] pairs (both elements are the same value).
Challenge: Verify that each entry is [value, value].