I tried the following code on my chrome developer console
array = [1,2,3]
[1, 2, 3]
copyarray = array
[1, 2, 3]
copyarray = [1]
[1]
array
[1, 2, 3]
copyarray = array
[1, 2, 3]
copyarray
[1, 2, 3]
copyarray.pop()
3
copyarray
[1, 2]
array
[1, 2]
copyarray+''
"1,2"
copyarray = copyarray +''
"1,2"
array
[1, 2]
Can anyone tell the reason why value of "array" changes when i use use some Array methods(like pop splice etc.) on "copyarray" variable?