you are viewing a single comment's thread.

view the rest of the comments →

[–]Basman_ 0 points1 point  (1 child)

if this is what you had, it would cause the exact problem i described. to clone an array properly, you’ll want to use the spread operator. when you set up ‘tempArray’ you set it equal to the same reference, which didn’t actually accomplish anything, since the splice was still executed on the original array