+ 3
JS yield - what is it and what do it ?
I will appreciate a good explanation about it...
3 Respuestas
+ 3
Okay, so the * makes the function a generator function: it returns an iterator, which is an object, that has a value, done value and a next method.
yield stops the function "execution", and returns the value after it.
Giving an argument to the next method will replace the yield statement with that value. So, y will be 7.
- 1
How can I change the language to german?