I want to repeat a string for a given number of times, How can I do that in Javascript?
repeat() method is used to repeat a string for n number of times. For example,
repeat()
let str = 'hello'; console.log(str.repeat(5));
Run here https://onecompiler.com/javascript/3xns34rrb