<p>What is the best or most concise method for returning a string repeated an arbitrary amount of times?</p>

<p>The following is my best shot so far:</p>

<pre><code>function repeat(s, n){
    var a = [];
    while(a.length &lt; n){
        a.push(s);
    }
    return a.join('');
}
</code></pre>

```
```
function repeat(s, n) { var r=""; for (var a=0;a<n;a++) r+=s; return r;}
```
```