這裏是我的代碼: class Prizes(object):
def __init__(self, purchases, n, d):
self.p = purchases
self.n = n
self.d = d
self.x = 1
def __iter__(self):
return self
d
我想測試下的js代碼: function* foo(x) {
var y = 2 * (yield (x + 1));
var z = yield (y/3);
return (x + y + z);
}
const it = foo(5);
// note: not sending anything into `next()` here
console.