The JavaScript string repeat()
method is used to repeat string values as many times as you specify inside the parenthesis:
let hipHop = "hiphop ".repeat(5)
console.log(hipHop)
// "hiphop hiphop hiphop hiphop hiphop "
The JavaScript string repeat()
method is used to repeat string values as many times as you specify inside the parenthesis:
let hipHop = "hiphop ".repeat(5)
console.log(hipHop)
// "hiphop hiphop hiphop hiphop hiphop "