Map - JavaScript | MDN
6
公开标注数
6
参与人数
2026-07-18 09:45:38
首次 Whisper
本页的公开 Whisper
划选高亮2026-07-18 16:09:38
原文高亮摘录
“the data itself is not cloned.”
Whisper 随想笔记
Wait, so if I mutate the object inside the map, the original changes too? That's kinda scary.
划选高亮2026-07-18 13:06:38
原文高亮摘录
“Maps can be iterated using a for...of loop”
Whisper 随想笔记
Is that any different from iterating an object? Seems obvious.
划选高亮2026-07-18 12:57:38
原文高亮摘录
“Maps can be iterated using a for...of loop”
Whisper 随想笔记
Yeah, for...of works fine but I always forget the destructuring syntax.
划选高亮2026-07-18 10:03:38
原文高亮摘录
“NaN can also be used as a key.”
Whisper 随想笔记
So it's like a black hole key, everything NaN just collapses into one.
划选高亮2026-07-18 09:54:38
原文高亮摘录
“NaN can also be used as a key.”
Whisper 随想笔记
I've been avoiding NaN as a key for nothing, good to know.
划选高亮2026-07-18 09:45:38
原文高亮摘录
“NaN can also be used as a key.”
Whisper 随想笔记
Wait, so NaN keys actually work? That's wild.
分享本页 Whisper
短链接
https://domwhisper.com/s/c6ceb1b3cc7f嵌入代码
<iframe src="https://domwhisper.com/embed/c6ceb1b3cc7f" width="100%" height="480" style="border:0;border-radius:16px" loading="lazy"></iframe>