Thank you Axel.
I'm new to this stuff and was trying to understand how next(myParameter) works and why it is necessary.
I also found it on mozilla dev documentation and now understand it:
"The next() method also accepts a value which can be used to modify the internal state of the generator. A value passed to next() will be treated as the result of the last yield expression that paused the generator."