Skip to content

Commit 79710c4

Browse files
authored
Update article.md
1 parent 1feed09 commit 79710c4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ obj = null;
248248
- An object exists in the set while it is reachable from somewhere else.
249249
- Like `Set`, it supports `add`, `has` and `delete`, but not `size`, `keys()` and no iterations.
250250

251-
Being "weak", it also serves as additional storage. But not for arbitrary data, but rather for "yes/no" facts. A membership in `WeakSet` may mean something about the object.
251+
Being "weak", it also serves as additional storage. But not for arbitrary data, rather for "yes/no" facts. A membership in `WeakSet` may mean something about the object.
252252

253253
For instance, we can add users to `WeakSet` to keep track of those who visited our site:
254254

@@ -280,9 +280,9 @@ The most notable limitation of `WeakMap` and `WeakSet` is the absence of iterati
280280

281281
## Summary
282282

283-
`WeakMap` is `Map` like collection that allows only objects as keys and removes them together with associated value once they become inaccessible by other means.
283+
`WeakMap` is `Map`-like collection that allows only objects as keys and removes them together with associated value once they become inaccessible by other means.
284284

285-
`WeakSet` is `Set` like collection that stores only objects and removes them once they become inaccessible by other means.
285+
`WeakSet` is `Set`-like collection that stores only objects and removes them once they become inaccessible by other means.
286286

287287
It's main advantages are that they have weak reference to objects, so they can easily be removed by garbage colector.
288288
That comes at the cost of not having support for `clear`, `size`, `keys`, `values` ...

0 commit comments

Comments
 (0)