How to make weak set or weak map "iterable" in ES6 so that i can use for in loop :
for(item in weakMap){console.log(item); }
How to make weak set or weak map "iterable" in ES6 so that i can use for in loop :
for(item in weakMap){console.log(item); }
No the contents of a WeakMap are not accessible by design, and there is no iterability.
A key property of Weak Maps is the inability to enumerate their keys. This is necessary to prevent attackers observing the internal behavior of other systems in the environment which share weakly-mapped objects. Should the number or names of items in the collection be discoverable from the API, even if the values aren't, WeakMap instances might create a side channel where one was previously not available.