基本: duplicate([1,2,3,4,5]) // [1,2,3,4,5,1,2,3,4,5] 進階 duplicateWithTimes([1,2,3,4,5], 3) // [1,2,3,4,5,1,2,3,4,5,1,2,3,4,5,1,2,3,4,5]
See the Pen
前端模擬試題 – 陣列複製 by Dean (@hcd1983)
on CodePen.0
基本: duplicate([1,2,3,4,5]) // [1,2,3,4,5,1,2,3,4,5] 進階 duplicateWithTimes([1,2,3,4,5], 3) // [1,2,3,4,5,1,2,3,4,5,1,2,3,4,5,1,2,3,4,5]
See the Pen
前端模擬試題 – 陣列複製 by Dean (@hcd1983)
on CodePen.0