The freeCodeCamp Forum
Repeat the Same Item Multiple Times
Curriculum Help
javascript
pradesh-kumar
June 10, 2018, 5:16pm
3
Try this
function repeat(item,times){ return new Array(times).fill(item); }
show post in topic
Related topics
Topic
Replies
Views
Activity
freeCodeCamp Challenge Guide: Repeat a String Repeat a String
freeCodeCamp Contributors
guide
32
171036
September 15, 2019
Repeat a string repeat a string
General
30
6294
September 17, 2017
Repet string repet string
General
4
776
October 24, 2017
基础算法 - 重复输出字符串1
General
chinese-中文
1
410
October 13, 2023
Repeat a string repeat a string?
General
1
715
May 30, 2017