Monday, June 3, 2024
98
rated 0 times [  105] [ 7]  / answers: 1 / hits: 15410  / 9 Years ago, fri, september 4, 2015, 12:00:00

A JavaScript WeakMap does not allow you to get the key, or the length or size, by design.


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


If not .. how does the Chrome console do this ?


enter


More From » garbage-collection

 Answers
39

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.


[#65184] Wednesday, September 2, 2015, 9 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
maurodannyr

Total Points: 126
Total Questions: 103
Total Answers: 105

Location: Maldives
Member since Sun, Feb 27, 2022
2 Years ago
maurodannyr questions
Fri, Jul 9, 21, 00:00, 3 Years ago
Thu, Sep 17, 20, 00:00, 4 Years ago
Sat, Sep 28, 19, 00:00, 5 Years ago
;