as it more closely matches Smalltalk collection iteration - ie

collection do: [:each | "do something to an element" ]

which seems to translate as

for_each(collection, function(each) { "do something to an element" })

much cleaner I think. The pointed to example is too Java ugly as it forces the developer to set up the loop, it just changes the loop conditions ie

var it = iterator(collection);
var item;
while(item = it.next()) { "do something to item" }

Incidentally, I'd probably have the iterator "reload" when it hits the end - IOW, reset i to -1 before returning null so you could use it again.