Basic ternary to if/then conversion in Javascript
<p>Would someone mind converting this line of ternary code to <code>if</code>/<code>then</code> statements. I understand ternary, but am not able to get syntax errors to go away when I convert to <code>if</code>/<code>then</code>. This is the only line of my homework I had to borrow and I'd like to make it into <code>if</code>/<code>then</code> so that I can comment on it and understand it better myself.</p>

<p>Original:</p>

<pre><code>return n == null || isNaN(n) ? 0 : n;
</code></pre>

<p>My attempt:</p>

<pre><code>return n == null || if(isNaN(n)){return 0;}else{return n;}
</code></pre>
