While generator functions are great (see my other EcmaScript6 posts), it is up to the caller function to take advantage. For example, the caller function might do nothing!
Presenting the most boring caller function passValue that just passes the value back to the generator.
1 | function *one() { |
One can remove the wildcard in front of *one
, remove yield
and use the
function directly, there is no difference.