Repeating a String
Problem
You want to repeat a string.
Solution
Create an array of n+1 nulls, and then join it with the repetition string as the glue:
Repeat method for Strings
You could also create a method for this in String prototype. It is as simple as that:
Discussion
JavaScript lacks a string repeat function, as does CoffeeScript. List comprehensions and maps can be pressed into service here, but in the case of a simple string repeat it’s easier to simply build an array of n+1 nulls and then glue them together.