Open DBadalyan opened 2 years ago
The assertion in the text comes from:
WeakMap(..)
counterpart to Map(..)
does in fact require only objects/functions as keys, so it's a frustrating gotcha if you've been in the habit of storing lots of non-object keys in Map and then you try to do so with a WeakMap and it fails.I totally agree with your arguments, and they are indeed very important. I just disagree with an idea to have that statement in that way so it can be misused somehow via referencing.
I understand that this is not a reference book and despite that, it is even important to have very clear and complete statements, considering book's popularity among beginners.
Might be somehow it can be introduced by other way which already will emphasize notions you listed above.
Thanks for replay.
PS: not a big deal actually, just trying to be idealistic.
Please type "I already searched for this issue": I already searched for this issue Edition: (pull requests not accepted for previous editions) 2-nd edition Book Title: Get Started Chapter: Chapter 3: Digging to the Roots of JS Section Title: Iteration -> Iterables Topic: Fixed statement about
Map
keys.