Javascript and yield function | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 6

Javascript and yield function

Yield seems a very interesting function, but I'm not able and google a good tutorial about. Do you know any?

12th Jan 2019, 1:01 PM
Paolo De Nictolis
Paolo De Nictolis - avatar
4 Answers
+ 3
Simple example of generator function and yield. Some applications, get delay value and values fromlong period execution function.
12th Jan 2019, 1:39 PM
Calviղ - avatar
12th Jan 2019, 5:36 PM
VEDANG - avatar
+ 6
The MDN web docs have a pretty decent example of what yield does. The description is also pretty on point. It's like a return statement for a function, but instead for a generator where you can 'yield' more than one value.
12th Jan 2019, 1:09 PM
Hatsy Rei
Hatsy Rei - avatar
+ 4
I knew MDN article. Thanks to Calvin for its code. Anything else?
12th Jan 2019, 3:48 PM
Paolo De Nictolis
Paolo De Nictolis - avatar