write a javascript function to clone an array