1 2 3 4 5 6 7 8 9 10 11 12
// for-of on an empty collection does not execute the loop body or modify the loop variable. function test(empty) { var x = 'unchanged'; for (x of empty) throw fit; assertEq(x, 'unchanged'); } test([]); test(new Map); test(new Set);