The easiest things to start using generators is to write sysadmin scripts that parse big files. Once you've done that, you get the memory benefit. Then the more you use it, the more you get the lazy evaluation benefit and you start using it elsewhere.
It's clearer in Python because:
- generators have there for ever
- we have unified way of iterating on things, and generators just work transparently
- you can start learning generators by just changing [] to () in your comprehension lists
So in JS it's much less obvious.
I just wrote a class to keep track of changes to an object using proxies yesterday. That way you can pass an object to a form, modify it in place and then roll back if needed. Also makes it easy to get deltas and only post the updates to the backend.
Very simple real-life use case: factor out logging and move it outside of normal logic of the object.