title: Limit min/max integer on javascript variable
body: <p>Im trying to make a talent calculator of sorts, clicking the 'skill' will decrease this variable and right-clicking will increase the variable.</p>
  
  <p>The problem i have is i want the variable to be limited from going over 50 or below 0. </p>
  
  <p>Now ive googled and searched here for variable limits and max integers but nothing gives me an idea how to do this, i think im wording my searches wrong.</p>
  
  <p>Could someone give me an idea how to do this or point me in the right direction please, thanks. </p>
  
  <p>Variable im using:</p>
  
  <pre><code>  var a=50;
    function decrease(){a--;document.getElementById('boldstuff').innerHTML= +a;}
    function increase(){a++;document.getElementById('boldstuff').innerHTML= +a;}
  </code></pre>