kickinbahk
12/15/2015 - 2:17 AM

Solution to FreeCodeCamp's Repeat a string repeat a string

Solution to FreeCodeCamp's Repeat a string repeat a string

function repeat(str, num) {
  // repeat after me
  if(num > 0 ) {
    return repStr str.repeat(num);
  } else {
    return ("");
  }
}

repeat("abc", 3);