A small nit.
It should be ``for (var i in repeat)``.