How to iterate over a WeakMap?

Is it possible to nevertheless loop over entries in some way?

No, as you say, the contents of a WeakMap are not accessible by design, and there is no iterability.

If not … how does the Chrome console do this?

The console uses the debugging API of the JS engine, which allows access to the internals of objects (also to promise states, wrapped primitives, etc.) and many more.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)