Using a standard for-loop instead of for-in