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
Give this a try :P
s = '#'.repeat(10) document.body.innerHTML = s