1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
var array = [1, 2, 3]; var calls = 0; var grouped = Object.groupBy(array, () => { calls++; return { toString() { return "a"; } } }); assertEq(calls, 3); if (typeof reportCompare === "function") reportCompare(0, 0);