Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit f17ad4a

Browse files
authored
WeakMap的弱引用键的描述容易有歧义
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap an object's presence as a `key` in a WeakMap does not prevent the object from being garbage collected. Once an object used as a key has been collected, its corresponding values in any WeakMap become candidates for garbage collection as well
1 parent e66e4f6 commit f17ad4a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

‎docs/es6/dataStructure.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ map.forEach((value, key) => { console.log(key, value)})
217217
218218
`Map`的区别
219219
- Map 的键可以是任意类型,WeakMap 的键只能是对象类型
220-
- WeakMap 键名所指向的对象,不计入垃圾回收机制
220+
- WeakMap 的键对象,不计入垃圾回收机制
221221

222222
`WeakMap` 的属性跟操作方法与 `Map` 一致,同 `WeakSet` 一样,因为是弱引用,所以 `WeakSet` 也没有遍历方法
223223

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /