Fixed the iteration on variable

Causes issues when the Array prototype has been extended