Skip to content

Commit 9974c8b

Browse files
committed
docs(generator-async): edit generator-async
1 parent b50f19b commit 9974c8b

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

docs/generator-async.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -506,10 +506,10 @@ run(g);
506506

507507
```javascript
508508
var g = function* (){
509-
var f1 = yield readFile('fileA');
510-
var f2 = yield readFile('fileB');
509+
var f1 = yield readFileThunk('fileA');
510+
var f2 = yield readFileThunk('fileB');
511511
// ...
512-
var fn = yield readFile('fileN');
512+
var fn = yield readFileThunk('fileN');
513513
};
514514

515515
run(g);

docs/set-map.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -536,7 +536,7 @@ map.get(k2) // 222
536536

537537
由上可知,Map 的键实际上是跟内存地址绑定的,只要内存地址不一样,就视为两个键。这就解决了同名属性碰撞(clash)的问题,我们扩展别人的库的时候,如果使用对象作为键名,就不用担心自己的属性与原作者的属性同名。
538538

539-
如果 Map 的键是一个简单类型的值(数字、字符串、布尔值),则只要两个值严格相等,Map 将其视为一个键,包括`0``-0`,布尔值`true`和字符串`true`则是两个不同的键。另外,`undefined``null`也是两个不同的键。虽然`NaN`不严格相等于自身,但 Map 将其视为同一个键。
539+
如果 Map 的键是一个简单类型的值(数字、字符串、布尔值),则只要两个值严格相等,Map 将其视为一个键,比如`0``-0`就是一个键,布尔值`true`和字符串`true`则是两个不同的键。另外,`undefined``null`也是两个不同的键。虽然`NaN`不严格相等于自身,但 Map 将其视为同一个键。
540540

541541
```javascript
542542
let map = new Map();

0 commit comments

Comments
 (0)