Optional chaining (?.) - JavaScript | MDN
5
公开标注数
5
参与人数
2026-07-23 09:59:37
首次 Whisper
本页的公开 Whisper
划选高亮2026-07-23 13:20:37
原文高亮摘录
“The nullish coalescing operator may be used after optional chaining in order to build a default value when none was found”
Whisper 随想笔记
Wait, but ?? only triggers on null/undefined, not on falsy values, right?
划选高亮2026-07-23 13:11:37
原文高亮摘录
“The nullish coalescing operator may be used after optional chaining in order to build a default value when none was found”
Whisper 随想笔记
Good tip, combining ?. with ?? saves so many lines of code.
划选高亮2026-07-23 10:17:37
原文高亮摘录
“This feature is well established and works across many devices and browser versions.”
Whisper 随想笔记
July 2020? Feels like it's been around forever already.
划选高亮2026-07-23 10:08:37
原文高亮摘录
“This feature is well established and works across many devices and browser versions.”
Whisper 随想笔记
Still don't trust it on older browsers in some enterprise apps.
划选高亮2026-07-23 09:59:37
原文高亮摘录
“This feature is well established and works across many devices and browser versions.”
Whisper 随想笔记
Finally, no more checking every nested property manually.
分享本页 Whisper
短链接
https://domwhisper.com/s/24df590208c6嵌入代码
<iframe src="https://domwhisper.com/embed/24df590208c6" width="100%" height="480" style="border:0;border-radius:16px" loading="lazy"></iframe>