Create a collection of key-value pairs where keys are objects and do not prevent garbage collection.
Source Code
let obj1 = {};
let obj2 = {};
let weakMap = new WeakMap([[obj1, 'value1'], [obj2, 'value2']]);
console.log(weakMap.get(obj1)); // "value1"