Rasi
answered Nov 30 '-1 00:00
WeakMap
WeakMap is little brother of Map whose is weak .weak means it hold reference weakly so it easy for garbage Collector to remove it when needed.
one can use WeakMap when you dont need strong bond for reference so instances or reference is garbage collected.
var device = new Object("name");
var deviceList = new WeakMap();
deviceList .set(device,"mobile");
in this example devices instance and its data will be garbage collected when devices object is no longer referenced by the rest of the application.
on another word we can say its "Weak memory bond which will be cleared if not refereed any more "