Why does this comma inside a ternary operator throw a syntax error in JavaScript? – stackoverflow.com

I noticed something odd when trying to use the comma operator inside the conditional (ternary) operator for logging. Here's a contrived example: const a = 2; const b = 1; a > b ? ...

from Hot Questions - Stack Exchange OnStackOverflow
via Blogspot

Share this

0 Comment to "Why does this comma inside a ternary operator throw a syntax error in JavaScript? – stackoverflow.com"