1
0
mirror of https://github.com/ruanyf/es6tutorial.git synced 2025-05-24 18:32:22 +00:00

docs(weakmap): 修正 weakMap 的例子 #536

This commit is contained in:
ruanyf 2017-11-03 08:18:18 +08:00
parent e845e10525
commit 2ac6e76b38

View File

@ -1034,8 +1034,9 @@ undefined
undefined
// 设置 WeakMap 实例的键名,也指向 key 数组
// 这时key 数组的引用计数为 2
// 变量 key 引用一次WeakMap 的键名引用第二次
// 这时key 数组实际被引用了两次,
// 变量 key 引用一次WeakMap 的键名引用了第二次
// 但是WeakMap 是弱引用对于引擎来说引用计数还是1
> wm.set(key, 1);
WeakMap {}