Did you know javascript comes with a handy repeat() function?
It allow us to repeat a string an x number of times. This used to be a tedious process using loops or while arrays.
Now we can call repeat() on a string
Making use of Javascript string.repeat()
As mentioned you can call this function on a String and it will repeat it an x number of times This x is the only arguements it takes
"seven".repeat(2);
//'sevenseven'
This makes it far clearer for the code to state a string is repeated two times.
Old-school, you might have found yourself doing something like this.
let output = "";
for (i = 0; i < 2; i++) {
output += "two";
}
As you can see a more tedious process. (There are some alternatives, but nothing as simple as calling repeat()).
Browser support
The browser support for the string.repeat is pretty good. Only IE can’t deal with it.

Thankyou for reading