copia array javascript

var bar = foo.slice();
Energetic Echidna