Use a normal for loop

The alternative being combining `for…in` with `hasOwnProperty` I thought using the vanilla loop was preferable.

This PR comes from an actual bug, due to the fact that the Array prototype had some additions.