In Perl I can repeat a character multiple times using the syntax:(在Perl中,我可以使用以下语法多次重复一个字符:)
$a = "a" x 10; // results in "aaaaaaaaaa"
Is there a simple way to accomplish this in Javascript?(有没有简单的方法可以在Javascript中完成此操作?) I can obviously use a function, but I was wondering if there was any built in approach, or some other clever technique.(我显然可以使用函数,但是我想知道是否有任何内置方法或其他一些巧妙的技术。)
ask by Steve translate from so
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…