Skip to content

Commit 76b6bce

Browse files
committed
docs(generator): edit generator
1 parent 37cf484 commit 76b6bce

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

docs/class-extends.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,7 @@ A.__proto__ === Function.prototype // true
499499
A.prototype.__proto__ === undefined // true
500500
```
501501

502-
这种情况与第二种情况非常像。`A`也是一个普通函数,所以直接继承`Function.prototype`。但是,`A`调用后返回的对象不继承任何方法,所以它的`__proto__`指向`Function.prototype`,即实质上执行了下面的代码。
502+
这种情况与第二种情况非常像。`A`也是一个普通函数,所以直接继承`Function.prototype`。但是,`A`调用后返回的对象不继承任何方法,所以它的`__proto__`指向`undefined`,即实质上执行了下面的代码。
503503

504504
```javascript
505505
class C extends null {

docs/generator.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -336,8 +336,8 @@ for (let v of foo()) {
336336
function* fibonacci() {
337337
let [prev, curr] = [0, 1];
338338
for (;;) {
339-
[prev, curr] = [curr, prev + curr];
340339
yield curr;
340+
[prev, curr] = [curr, prev + curr];
341341
}
342342
}
343343

0 commit comments

Comments
 (0)