SyntaxFix
Write A Post
Hire A Developer
Questions
A great ES6 option would be to padStart an empty string. Like this:
padStart
var str = ''.padStart(10, "#");
Note: this won't work in IE (without a polyfill).