I see Javascript closures as functions with local states, which appears to be the same thing as generators.
- What's the difference between a closure and a generator?
- What would make one a more fitting tool than another for some context?
I see Javascript closures as functions with local states, which appears to be the same thing as generators.