You reached the end of the iterator with the first loop, so there aren't any elements left in it to iterate over. That's consistent to how iterators work in other languages at least.
I know that as per the iterator spec this is normal behaviour. It just seems to me that the behaviour that follows from this is really quite strange. When I want to be able to loop over the contents twice, how am I supposed to to that?
Depends on what your generator does. If it just does simple calculations, just generate a second instance of it.
Otherwise there are constructions that provide a virtual copy of an iterator and cache the values they still need for the second loop.
Or just don't use an iterator if it doesn't fit the model you need, or turn it into an array before.
(Part of) the idea behind generators is that you don't store all results, because they could be a long or possibly even infinite sequence. E.g. in Python the basic iterator is range(X), which returns the numbers from 0 to X-1. If X=100000, it is a bad idea to generate a giant list of all those numbers, just because you want to know how often you ran through a loop.
My specific use case was working with 'infinite lists', so the first options is ruled out.
The second option could be a solution, but the specific case was reusing a variable `const nums = iu.iterate(x => x+1, 1)`, and quite extensively. (It's just a helper function to make a list of all natural numbers)
It would be so much nicer if I could just reuse this variable throughout my code