Skip to content

Commit 58b7d72

Browse files
authored
Merge pull request #757 from GarciaPL/patch-1
Update article about WeakMap's delete function
2 parents 04fa38a + f725537 commit 58b7d72

File tree

1 file changed

+1
-1
lines changed
  • 1-js/05-data-types/07-map-set-weakmap-weakset

1 file changed

+1
-1
lines changed

1-js/05-data-types/07-map-set-weakmap-weakset/article.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ Compare it with the regular `Map` example above. Now if `john` only exists as th
328328
329329
- `weakMap.get(key)`
330330
- `weakMap.set(key, value)`
331-
- `weakMap.delete(key, value)`
331+
- `weakMap.delete(key)`
332332
- `weakMap.has(key)`
333333
334334
Why such a limitation? That's for technical reasons. If an object has lost all other references (like `john` in the code above), then it is to be garbage-collected automatically. But technically it's not exactly specified *when the cleanup happens*.

0 commit comments

Comments
 (0)