blob: 2925c801f88323bb837e152424c6036629f82865 (
plain)
1
2
3
4
5
6
7
8
9
10
|
// Clearing a Map after deleting some entries works.
var m = new Map([["a", 1], ["b", 2], ["c", 3], ["d", 4]]);
for (var [k, v] of m)
if (k !== "c")
m.delete(k);
m.clear();
assertEq(m.size, 0);
assertEq(m.has("c"), false);
assertEq(m.has("d"), false);
|