not to repeat string in array in javascript function 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);