The freeCodeCamp Forum
Repeat the Same Item Multiple Times
JavaScript
pradesh-kumar
June 10, 2018, 5:16pm
3
Try this
function repeat(item,times){ return new Array(times).fill(item); }
3 Likes
show post in topic
Related topics
Topic
Replies
Views
Activity
## Repeat a String Repeat a String
JavaScript
2
421
February 2, 2021
Repeat a string repeat a string
31
5864
January 16, 2021
Repet string repet string
5
711
January 17, 2021
Basic algorithm: Repeat a String. loop problem
JavaScript
14
1456
February 2, 2021
Debugging Repeat a String Repeat a String
JavaScript
3
410
February 2, 2021