For Each Loop Javascript Array Shift