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
This one is pretty efficient
String.prototype.repeat = function(times){ var result=""; var pattern=this; while (times > 0) { if (times&1) result+=pattern; times>>=1; pattern+=pattern; } return result; };