Skip to content

Commit f725537

Browse files
authored
Update article about WeakMap's delete function
It seems that it's small typo in delete function of WeakMap as according to specification delete function takes only one parameter - key
1 parent 028b80c commit f725537

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)