Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function repeatStringNumTimes(str, num) {
- if (num>0){
- return str.repeat(num);
- }
- else {
- return "";
- }
- }
- repeatStringNumTimes("abc", 3);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement