michael@0: // The argument to Set may contain a value multiple times. Duplicates are discarded. michael@0: michael@0: assertEq(Set(["testing", "testing", 123]).size, 2); michael@0: michael@0: var values = [undefined, null, false, NaN, 0, -0, 6.022e23, -Infinity, "", "xyzzy", {}, Math.sin]; michael@0: for (let v of values) { michael@0: var a = [v, {}, {}, {}, v, {}, v, v]; michael@0: var s = Set(a); michael@0: assertEq(s.size, 5); michael@0: assertEq(s.has(v), true); michael@0: }