Skip to main content
Journey Uncommon Logo
JourneyUncommon
mediumJavaScriptMap Set WeakMapSingle-choice MCQ

What does this Set deduplication log, given how NaN and +0/-0 are treated?

const s = new Set(); s.add(NaN); s.add(NaN); s.add(0); s.add(-0); console.log(s.size); console.log([...s]);