using the multiplication operator to repeat a character in javascript code example
Example 1: js multiply string
let myString = 'test';
myString.repeat(3); // 'testtesttest'
Example 2: string repeat javascript
// best implementation
repeatStr = (n, s) => s.repeat(n);