blob: c9c760f7ef9a16bd21de65a9565a91f750043ae6 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
|
// The argument to Set can be a generator.
function* hexData(n) {
for (var i = 0; i < n; i++)
yield i.toString(16);
}
var s = new Set(hexData(256));
assertEq(s.size, 256);
assertEq(s.has("0"), true);
assertEq(s.has(0), false);
assertEq(s.has("ff"), true);
|