Created
July 9, 2018 12:09
-
-
Save nairihar/189302d3ee6bcd09ac0cb8c5bab5bcdb to your computer and use it in GitHub Desktop.
JavaScript series, part 3, WeakMap and WeakSet, medium
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const weakMap = new WeakMap(); | |
let obj = {}; | |
weakMap.set(obj, 11); | |
weakMap.get(obj); | |
// 11 | |
console.log(weakMap); | |
obj = 1; | |
console.log(weakMap); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment