title: Is there a way to prevent a number from being negative in JavaScript?
body: <p>Is there any other more convenient way of preventing variable from going negative than a <code>if</code> statement?</p>
  <h3>Example code</h3>
  <pre><code>var scrollTop = window.pageYOffset,
      sW = (44 - .06*scrollTop);
  
  if( sW &lt; 0 ){ sW = 0; }
  </code></pre>