title: Using a global variable in JavaScript
body: <p>How do I do this?</p>
  <p>My code is something like this:</p>
  <pre><code>var number = null;
  
  function playSong(artist, title, song, id)
  {
      alert('old number was: ' + [number] + '');
  
      var number = '10';
  
      alert('' + [number] + '');
  }
  </code></pre>
  <p>The first alert always returns 'old number was: ' and not 10. Shouldn't it return 10 on both alerts on the second function call?</p>