title: Changing the boolean value on click
body: <p>I am trying to change the variable from false to true on click</p>
  
  <pre><code>var $popupStatus = false;
  
  $('li a').click(function() {  
    console.log('The list item has been clicked'); // This console log is successful
    $popupStatus = true;
  });
  
  if($popupStatus) {
    console.log('The popup variable is true;'); // This console log doesn't show up
  }
  </code></pre>
  
  <p>I know this must have something to do with scope but I can't see where I'm going wrong, thanks for the help.</p>