How to deep copy an array in javascript