The comma operator evaulates each of its operand from left to right, returning the result of the last.
For example:
x = (1, 2, 4);
console.log(x); // prints 4
Can be very useful to quickly debug arrow functions not surrounded by brackets. For example, check the following JSX example.
function InputWrapper() {
return (
<Input
onChange={(ev) => (console.log(ev), doSomething(ev))}
/>
);
}
Sources: