Advertisement
Guest User

Untitled

a guest
Mar 29th, 2017
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.15 KB | None | 0 0
  1. function repeatStringNumTimes(str, num) {
  2. if (num>0){
  3. return str.repeat(num);
  4. }
  5. else {
  6. return "";
  7. }
  8. }
  9.  
  10. repeatStringNumTimes("abc", 3);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement