title: If statement within JavaScript function not working
body: <p>I have the following function</p>
  
  <pre><code>var VisibilityNewDevice = 1
  function visibilityNewDevice() {
      if (VisibilityNewDevice === 1) {
           toggleVisibility('buttonPressesTable'),
           toggleVisibility('IconMinimize'),
           toggleVisibility('IconSync'); 
           var VisibilityNewDevice = 0;
      }
  }
  </code></pre>
  
  <p>Which if I call <code>visibilityNewDevice()</code> I get <code>undefined</code> returned and doesn't run the code. However if I run the like this</p>
  
  <pre><code>if (VisibilityNewDevice === 1) {
      toggleVisibility('buttonPressesTable'),
      toggleVisibility('IconMinimize'), 
      toggleVisibility('IconSync'); 
      var VisibilityNewDevice = 0;
  }
  </code></pre>
  
  <p>It works fine. I'm confused why the <code>function</code> doesn't work, but when I run the <code>if</code> statement it works fine.</p>