title: jS: On click function add number to variable - gives NaN
body: <p>My problem is simple, I'm failing to add to a global variable in javascript using the click event. It returns a <code>NaN</code> outcome.</p>
  
  <pre><code>var xx = 50;
  
  $('div').click(function(){
    var xx = xx + 10;
    alert(xx)
  });
  </code></pre>
  
  <p><a href="https://jsfiddle.net/1beo7mgw/" rel="nofollow noreferrer">JSFIDDLE</a></p>