Repeat the Same Item Multiple Times

Try this

function repeat(item,times){
    return new Array(times).fill(item);
}
3 Likes