title: How can I loop this function so that the animation repeats infinitely?
body: <p>I'm trying to adapt this function to loop infinitely, but the usual setInterval is not working.  I'd need the loop to start over completely, clearing the function I guess first?  </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>let ascii = document.querySelector('.ascii').textContent;
  let asciiLetters = ascii.split('');
  let displayLetters = document.querySelector("#text");
  
  function animate() {
    asciiLetters.length &gt; 0 ? displayLetters.innerHTML += asciiLetters.shift() : clearTimeout(moveType);
    let moveType = setTimeout(animate, 5);
  };
  
  animate();</code></pre>
  <pre class="snippet-code-css lang-css prettyprint-override"><code>body {
    background-color: black;
  }
  
  .container {
    color: lime;
    overflow: hidden;
    width: 100%;
    height: 100%;
    position: fixed;
    top: 0;
    left: 0;
    display: flex;
    align-items: center;
    align-content: center;
    justify-content: center;
  }
  
  .ascii {
    display: none;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>  &lt;div class="container"&gt;
      &lt;pre class="ascii ascii-0"&gt;
      __     _ 
     / /_   (_)
    / __ \ / / 
   / / / // /  
  /_/ /_//_/  
      &lt;/pre&gt;
      &lt;pre id="text"&gt;&lt;/pre&gt;
    &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>I'm sure there is a simple solution but I'm struggling to find it!</p>