TZinovieva

Repeat String

Jan 30th, 2023
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function repeatString(str, n) {
  2.     let result = '';
  3.     for (let i = 0; i < n; i++) {
  4.         result += str;
  5.     }
  6.     console.log(result);
  7. }
Advertisement
Add Comment
Please, Sign In to add comment