+ 6
Is there an easy way to repeat a char n times in javascript without the use of a function?
4 Réponses
+ 7
@Sandeep Chatterjee I meant: without writing a function on my own that would obviously contain loops...
+ 6
Well, I actually found a way:
Array(n+1).join("a") results in "aaaaaaa" (n times)
+ 1
that's great nice but loops are not function the join() is a function
does this works
+ 1
ok it is nice 😀