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?
4 Replies
Even doing it like this breaks my original array called CID ...
What is causing this?
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
How and why are they linked, am I doing something wrong?
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