How to optimize this if-else statement in javascript
<p>I have a piece of javascript code like this </p>

<pre><code>        if(prog &gt; 100)
          prog = 100;
        else if(prog &lt;0)
          prog = 0;
        else if(typeof prog != 'number')
          prog = 0;
</code></pre>

<p>It looks bad and ugly. Is there some cooler way to write this in javascript?</p>
