1 posts in total

Weakmap

Posts tagged

WeakMaps in JavaScript

by Syed Aslam · 2 min read

There are situations when you want to use an object or an array as a key. Unfortunately, JavaScript objects allow only strings are keys. With ES6, JavaScript gives us a second type of object called a WeakMap that allows objects as keys.