Why JavaScript's Secret Comma Operator is So Darn Useful

from blog taylor.town, | β†— original
Did you know you could do this in JS? let n = (0, 1); console.log(n); // 1 And this? let n = 0; n = (n++, n++, n); console.log(n); // 2 And this? // πŸ˜’ if (x) { foo(); return bar(); } else { return "baz"; } // 😍 return x ? (foo(), bar()) : "baz"; And this? // πŸ˜’ const f = x => { x[0]=42; return x; }; // 😍 const g = x => (x[0]=42, x); At...