1 parent b6d5ad8 commit 5a517cdCopy full SHA for 5a517cd
1 file changed
js codes.docx
@@ -2802,4 +2802,11 @@ for(let [key,value] of myMap){
2802
console.log(`keys ${key}, value ${value}`)
2803
}
2804
=======================================================================================================================================================================
2805
-WeakSet: only store object, can't iterate
+WeakSet: only store object, can't iterate with for/foreach
2806
+let ws = new WeakSet()
2807
+const obj={"name":"priya"}
2808
+ws.add(obj)
2809
+console.log(ws.has(obj));
2810
+WeakMap: It's similar to WeakSet where can't able to iterate and only stores an object
2811
+======================================================================================================================================================================
2812
+
0 commit comments