Unexpected variable changes

a student of mine has been trying to recreate snake outside of a grid
to do this he is trying to store an array from the previous frame. but its being changed from something we cant figure out
the code is:
sp2=snake_positions;
console.log("sp2= "+sp2);

snake_positions[0]=positionobject.x+positionobject.velocityX;
snake_positions[1]=positionobject.y+positionobject.velocityY;

console.log("sp2= "+sp2);

Code.org

whats supposed to happen is the same number gets logged twice
but what actually happens is two different numbers get logged
and we tried using 2 different variables that should be the same getting logged but it was still different