Skip to content

Commit

Permalink
docs(set-map): fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
nicong622 committed Jul 24, 2022
1 parent 9348fd2 commit 010de73
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/set-map.md
Original file line number Diff line number Diff line change
Expand Up @@ -942,7 +942,7 @@ map.set(null, 2)

上面代码中,如果将数值`1``Symbol`值作为 WeakMap 的键名,都会报错。

不过,现在有一个[提案](https://github.com/tc39/proposal-symbols-as-weakmap-keys),允许 Symbol 值也可以作为 WeakMap 的键名。一旦纳入标准,就意味着键名存在两种可能:对象和 Symbole 值。
不过,现在有一个[提案](https://github.com/tc39/proposal-symbols-as-weakmap-keys),允许 Symbol 值也可以作为 WeakMap 的键名。一旦纳入标准,就意味着键名存在两种可能:对象和 Symbol 值。

其次,`WeakMap`的键名所指向的对象,不计入垃圾回收机制。

Expand Down

0 comments on commit 010de73

Please sign in to comment.