I have a four-element array that I need to copy to another array four times. I achieved this by concatenating the array four times.
Here is what I tried:
let demoProperties = []
.concat(fourDemoProperties)
.concat(fourDemoProperties)
.concat(fourDemoProperties)
.concat(fourDemoProperties);
I also attempted another approach using map and reduce, but it required iterating twice.
If anyone knows of a simpler or more efficient way to copy an array N times, I would greatly appreciate any suggestions you may have.