So, my question has been asked by someone else in it\'s Java form here: Java - Create a new String instance with specified length and filled with specific character. Best so
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).