title: Javascript repeat a function x amount of times
body: <p>I'm trying to develop a function that repeats a function x amount of times, just once, not based on <code>settimerinterval</code> or <code>settimeout</code> or anything based on time.  I don't want to use a while/for loop <strong>directly</strong>, I want to use this repeat function.</p>
  
  <p>I've tried something like this:</p>
  
  <pre><code>function repeat(func, times) {
    for (x = 0; x &lt; times; x++) {
      eval(func)
    }
  }
  </code></pre>
  
  <p>But <code>eval</code> doesn't work on a function.</p>