C ++ program to concatenate a string given number of times | Function which return string by concatenating it . ; Copying given string to temporary string . ; s += s1 ; Concatenating strings ; Driver code
function repeat ( s , n ) { let s1 = s ; for ( let i = 1 ; i < n ; i ++ ) return s ; } let s = " " ; let n = 3 ; document . write ( repeat ( s , n ) ) ;