Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Mishterius |
I have recently run into a peculiar problem. I have a global variable called board (2d array). And within a function, I have a local variable called modboard, which I set to be equal to board:
var modboard=board
Then I change something about modboard:
modboard[1][0]=‘something’
But for some reason, that same change is applied to board. I do not understand why that happens or how to fix that. Please help.