1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
let objs = []; for (let i = 0; i < 100; i++) { let obj = {}; obj["x" + i] = 1; obj[undefined] = 2; obj[null] = 3; objs.push(obj); } function foo(obj) { assertEq(obj[undefined], 2); assertEq(obj[null], 3); } for (let i = 0; i < 100; i++) { foo(objs[i]); }