let string = 'Plumbus' let count = 3 string.repeat(count); // -> 'PlumbusPlumbusPlumbus'
var a="a"; var aaa=a.repeat(3); // "aaa"
repeatStr = (n, s) => s.repeat(n);
function repeatStringNumTimes(string, times) { var repeatedString = ""; while (times > 0) { repeatedString += string; times--; } return repeatedString; } repeatStringNumTimes("abc", 3);
function repeatStr (n, s) { return s.repeat(n) } /////////////////////////////similar/////////////////////////////////////////// repeatStr = (n, s) => s.repeat(n);