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
With ES8 you could also use padStart or padEnd for this. eg.
padStart
padEnd
var str = 'cat'; var num = 23; var size = str.length * num; "".padStart(size, str) // outputs: 'catcatcatcatcatcatcatcatcatcatcatcatcatcatcatcatcatcatcatcatcatcatcat'