Array issue (Unwanted changes to the array)

HI! So I am setting the const change [] to be equal to cid [] After that I alter the const change so that the values return to 0 Yet for some reason, cid is altered and returns 0 on everything?
No description
4 Replies
Brightie
BrightieOP15mo ago
Even doing it like this breaks my original array called CID ... What is causing this?
No description
Brightie
BrightieOP15mo ago
are the values in change[] linked to the values in cid[] in some way? I figured maybe if I do it via a .push() instead of a straightup change = cid it would fix it, but it doesn't
Brightie
BrightieOP15mo ago
How and why are they linked, am I doing something wrong?
No description
Brightie
BrightieOP15mo ago
Okay, so this has fixed it Do not ask me why it works correctly when I do it this way However I would love an explanation if someone can explain it to me
No description
Want results from more Discord servers?
Add your server