JSFiddle - React, Tailwind, and code Playground
JavaScript
let arr = [1, 2, 3]
for(let i = 0; i<= 20; i++){
if(i > arr.length){
arr.push(...arr)
}
}
console.log(arr)
let arr = [1, 2, 3]
for(let i = 0; i<= 20; i++){
if(i > arr.length){
arr.push(...arr)
}
}
console.log(arr)