Clone an array to maintain the order before the looping in each()