Skip to main content
2 of 2
replaced http://stackoverflow.com/ with https://stackoverflow.com/

The repeatSpaces function: I must have missed something.

Could you not use a built-in like String.repeat ? (works in Chrome 31)

If it is not available a shim like:
https://stackoverflow.com/a/202627/684890

String.prototype.repeat = function repeat(repeatTimes)
{
    return new Array(repeatTimes+ 1).join(this);
};

would be sufficient?

James Khoury
  • 3.2k
  • 1
  • 25
  • 52