Hacker News new | ask | show | jobs
by notNow 3914 days ago

  while(!iterator.next().done)
I think you meant the above example and not the one you listed in the comment as generator objects in JS always return objects upon calling next method even after finish yielding for long and thus you could have an infinite loop on your hand here.