var arr = [1, 0, , "foo"]; //1. arr = []; //2 arr.length = 0;
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])
var arr = ['a', 'b', 'c', 'd', 'e']; arr.splice(0, arr.length); alert(arr.length);