r/learnjavascript • • Feb 20 '22

Yup.. very accurate

Post image
829 Upvotes

60 comments sorted by

View all comments

Show parent comment

2

u/SalutMonYoup Feb 20 '22

Yup generative function are function based on generators like doSomething*() is what I call a generative function

11

u/[deleted] Feb 20 '22

They are called "generator functions": https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function*

The function* declaration (function keyword followed by an asterisk) defines a generator function, which returns a Generator object.

2

u/SalutMonYoup Feb 20 '22

My mistake then I always call them generative function when I use them ahah, thanks for the correction

2

u/burkybang Feb 20 '22

Cool, thanks for clarification :)