var a=[1,2,3]; var i; i=a[1]; a[1]=a[2]; a[2]=i; alert(a);
var a = [1, 2, 3]; a.push(a.splice(1,1)); alert(a);