The Comma Operator

The comma operator evaluates its operands left to right and yields the last: (console.log("hi"), 42) logs once and evaluates to 42. Its natural home is a for header that steps two counters, for (i = 0, j = 10; i < j; i += 3, j -= 3), and a reducer that mutates and returns in one expression, (acc, v) => (acc.push(v), acc). Commas in argument lists, array literals and declarations are mere separators.