Or operator vs. Ternary operator : <p>Which piece of code is faster, or just better?</p>

<hr>

<p><strong>Ternary operator</strong></p>

<pre><code>action = typeMap[type] ? typeMap[type] : typeMap['default'];
</code></pre>

<hr>

<p><strong>Or operator</strong></p>

<pre><code>action = typeMap[type] || typeMap['default']
</code></pre>

<hr>

<p>Thank you!</p>
