Generator: yield expressions
The yield keyword is used to pause and resume a generator function
Donate to NGO Julenka. Support Ukranians in need.
Julenka is an NGO which my brother founded in 2011 to support Ukranian families and kids in need.
yield is used to pause and resume a generator function
- converting a generator to an array (using
Array.from) resumes the generator until all values are received
after the first
- the value is "hello"
done is false
after the second
value is "world"
done is still false
after stepping past the last element, calling
next() that often
done property equals true, since there is nothing more to iterator over
Describing the `yield` keyword.