我有一個包含四個元素的數組,我想將它複製到另一個數組四次,並且通過連接四次完成它。將陣列N次複製到分層陣列
我的努力
let demoProperties = []
.concat(fourDemoProperties)
.concat(fourDemoProperties)
.concat(fourDemoProperties)
.concat(fourDemoProperties);
我也跟着另一個way(映射,減少),但這種方式迭代兩次。
有沒有任何最簡單的方法複製N次?任何你的建議將不勝感激。