What is the best or most concise method for returning a string repeated an arbitrary amount of times?
The following is my best shot so far:
function
Simple method:
String.prototype.repeat = function(num) { num = parseInt(num); if (num < 0) return ''; return new Array(num + 1).join(this); }