Multiple operations in ternary operator <p>Is it possible to have multiple operations within a ternary operator's if/else?</p> <p>I've come up with an example below, probably not the best example but I hope you get what I mean.</p> <pre><code>var totalCount = 0; var oddCount = 0; var evenCount = 0; for(var i = 0; i &lt; arr.length; i++) { if(arr[i] % 2 === 0) { evenCount ++; totalCount ++; } else { oddCount ++; totalCount ++; } } </code></pre> <p>into something like:</p> <pre><code>var totalCount = 0; var oddCount = 0; var evenCount = 0; for(var i = 0; i &lt; arr.length; i++) { arr[i] % 2 === 0? evenCount ++ totalCount ++ : oddCount ++ totalCount ++; } } </code></pre>