title: How can I call an anonymous function from inside itself in JavaScript?
body: <p>Is it possible to re-run the function 'check' without calling check() in the else statement? Maybe call itself somehow?</p>
  
  <p>If I have multiple instances of this function, they end up calling each other, unless I change it to check1, check2, etc.. While this is prob. a performance killer, I was just trying it out for a prototype app.</p>
  
  <pre><code>(function check () {
    if (typeof foo !='undefined') {
      // do stuff
    } else {
      console.log("Failed to load, trying again");
      setTimeout(function(){ check(); }, 10);
    }
  })();
  </code></pre>