When would you choose a generator over returning an array? What are the memory trade-offs? | Iterator and Generator | javascript Interview Questions | NextRound.in