Skip to content

Commit 5a517cd

Browse files
authored
Update js codes.docx
1 parent b6d5ad8 commit 5a517cd

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

‎js codes.docx‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2802,4 +2802,11 @@ for(let [key,value] of myMap){
28022802
console.log(`keys ${key}, value ${value}`)
28032803
}
28042804
=======================================================================================================================================================================
2805-
WeakSet: only store object, can't iterate
2805+
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

Comments
 (0)