repeatedString.js
// Approach #2: Repeat a String with a While Loop
Approach #2: Repeat a String with a While Loop
Approach #2 : Repeat a String with a While Loop
function repeatStringNumTimes(string, times) {
  let repeatedString = "";
  while (times > 0) {
    repeatedString += string;
    times--;
  }
  return repeatedString;
}
function repeatStringNumTimes ( string , times ) { let repeatedString = "" ; while ( times > 0 ) { repeatedString += string ; times -- ; } return repeatedString ; }
Approach #2: Repeat a String with a While Loop
Approach #2 : Repeat a String with a While Loop