title: Counter in Node.js
body: <p>I'm trying to make a Node.js counter function which will count in the terminal until I stop it.
  However, I'm having a problem with it.</p>
  <p>Here's my code:</p>
  <pre class="lang-js prettyprint-override"><code>async function test() {
    var count = 1
    var newcount = count + 1
    var count = newcount
    console.log(count)
  }
  </code></pre>
  <p>The count stays on <strong>1</strong>.
  I know why this is, I just don't know how to fix it.
  It stays on 1 because I'm declaring it as 1 every loop.
  It does go to 2, but it doesn't go any higher because of what I just said. I can't figure out how to <em>stop</em> it from declaring as 1 every loop.</p>
  <p>So if anyone could help, that'd be great.</p>
  <h2>Edit:</h2>
  <p>I forgot to put this in my code snippet:</p>
  <pre class="lang-js prettyprint-override"><code>setInterval(test, 10000)
  </code></pre>