var array = [0,1,2,3]; var foo = array, bar = array; foo = []; alert(foo[2]) alert(bar[2])
var array = [0,1,2,3]; var foo = array, bar = array; foo.length = 0; alert(foo[2]) alert(bar[2])