Skip to content

Commit b0d39f8

Browse files
authored
Merge pull request #1292 from Violet-Bora-Lee/patch-26
minor
2 parents 4ed5a0d + 6fc41ba commit b0d39f8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

1-js/05-data-types/08-weakmap-weakset/article.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ We can avoid it by switching to `WeakMap` instead:
155155

156156
```js
157157
// 📁 visitsCount.js
158-
let visitsCountMap = new WeakMap(); // map: user => visits count
158+
let visitsCountMap = new WeakMap(); // weakmap: user => visits count
159159

160160
// increase the visits count
161161
function countUser(user) {
@@ -164,7 +164,7 @@ function countUser(user) {
164164
}
165165
```
166166

167-
Now we don't have to clean `visitsCountMap`. After `john` object becomes unreachable by all means except as a key of `WeakMap`, it gets removed from memory, along with the information by that key from `WeakMap`.
167+
Now we don't have to clean `visitsCountMap`. After `john` object becomes unreachable by all means except as a key of `WeakMap`, it gets removed from memory, along with the information by that key from `WeakMap`.
168168

169169
## Use case: caching
170170

0 commit comments

Comments
 (0)