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
String.prototype.repeat = function (n) { n = Math.abs(n) || 1; return Array(n + 1).join(this || ''); }; // console.log("0".repeat(3) , "0".repeat(-3)) // return: "000" "000"