In Perl I can repeat a character multiple times using the syntax:
$a = \"a\" x 10; // results in \"aaaaaaaaaa\"
Is there a simple way to ac
function repeatString(n, string) { var repeat = []; repeat.length = n + 1; return repeat.join(string); } repeatString(3,'x'); // => xxx repeatString(10,'