Javascript Array Copy Methods Suggestion
{ Slice }
let sourceArr = [1, 2, 3]
let copyArr = []
copyArr = sourceArr.slice()
{ Concat }
let sourceArr = [1, 2, 3]
let copyArr = []
copyArr = sourceArr.concat()
{ Result }
concat is better, faster and stabler
Leave Comment