1 2 3 4 5 6 7

pow = ( function * () { return Math . pow (( yield "x" ), ( yield "y" )); }()); pow . next (); // Object { value: "x", done: false } pow . next ( 2 ); //Object { value: "y", done: false } pow . next ( 3 ); //Object { value: 8, done: true }