var foo = [1,2,3];
bar = function1(foo);
bar = function2(foo);
bar = function3(foo);
function function1(newFoo){
return [newFoo,'a',1];
} //foo after function1 = 1,2,3
function function2(newFoo){
var otherFoo = newFoo.slice(0);
otherFoo[0] = 'a';
return otherFoo;
} //foo after function2 = 1,2,3
function function3(newFoo){
var otherFoo = newFoo.slice(0);
otherFoo.push('4');
return otherFoo;
} //foo after function2 = 1,2,3