From af181ce0fef56687a04db10f6d2eec5e89af1016 Mon Sep 17 00:00:00 2001 From: Dharmveer Bharti <56690664+d-Bharti001@users.noreply.github.com> Date: Sun, 20 Apr 2025 19:11:11 +0530 Subject: [PATCH] Update WeakMap and WeakSet: object reference is stored in array Earlier sentence: > the object previously referenced by john is stored inside the array But the object itself is not stored in the array. Its reference gets stored in the array. Updated sentence: > the object previously referenced by john is still referenced by the first element in the array --- 1-js/05-data-types/08-weakmap-weakset/article.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/1-js/05-data-types/08-weakmap-weakset/article.md b/1-js/05-data-types/08-weakmap-weakset/article.md index 9795017d41..9241446493 100644 --- a/1-js/05-data-types/08-weakmap-weakset/article.md +++ b/1-js/05-data-types/08-weakmap-weakset/article.md @@ -32,7 +32,7 @@ let array = [ john ]; john = null; // overwrite the reference *!* -// the object previously referenced by john is stored inside the array +// the object previously referenced by john is still referenced by the first element in the array // therefore it won't be garbage-collected // we can get it as array[0] */!*
Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.
Alternative Proxies: