JavaScript: Is there any "python's Generator" equivalent in JavaScript?

Posted by JackSMTV on Stack Overflow See other posts from Stack Overflow or by JackSMTV
Published on 2012-06-23T03:07:04Z Indexed on 2012/06/23 3:16 UTC
Read the original article Hit count: 114

Filed under:
|

Is there any "python's Generator" equivalent in JavaScript?

PS: Python's Generator is very memory efficient when we need to do one time iterate through a big array, hash...
"Generators are iterables, but you can only read them once. It's because they do not store all the values in memory, they generate the values on the fly"

(Python's Generator explained in this thread: The Python yield keyword explained )

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about iteration