JavaScript
31.9K subscribers
1.01K photos
9 videos
33 files
691 links
A resourceful newsletter featuring the latest and most important news, articles, books and updates in the world of #javascript 🚀 Don't miss our Quizzes!

Let's chat: @nairihar
Download Telegram
CHALLENGE

let obj = { name: 'Sarah', age: 25 };
let weakMap = new WeakMap();
let map = new Map();

weakMap.set(obj, 'weak reference');
map.set(obj, 'strong reference');

console.log(weakMap.has(obj));
console.log(map.has(obj));

obj = null;

console.log(weakMap.has(null));
console.log(map.has(null));
console.log(map.size);