title: How to create an infinite loop in NodeJS
body: <p>I've seen a bunch of answers on JS about an infinite loop and I thought that it would help for my code but it doesn't seem to be working properly.
  I have that: </p>
  
  <pre><code>var i = 0
  
  while (true) {
    setTimeout(() =&gt; {
      i ++
      console.log('Infinite Loop Test n:', i);
    }, 2000)
  }
  </code></pre>
  
  <p>The objective is to get the log every 2 seconds within an infinite loop but I can't seem to be getting anything back... Where am I mistaken? </p>
  
  <p>Thanks in advance for your help as usual! </p>