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
This commit is contained in:
Lukasz Ciesluk 2019-01-25 09:00:04 +00:00 committed by GitHub
parent 028b80cf9d
commit f725537743
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -328,7 +328,7 @@ Compare it with the regular `Map` example above. Now if `john` only exists as th
- `weakMap.get(key)`
- `weakMap.set(key, value)`
- `weakMap.delete(key, value)`
- `weakMap.delete(key)`
- `weakMap.has(key)`
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*.