Arrow function expressions - JavaScript | MDN
5
Public whispers
5
Contributors
2026-07-19 09:45:44
First whispered
Public whispers on this page
Text Highlight2026-07-19 13:06:44
Original Highlight Excerpt
"Perhaps the greatest benefit of using arrow functions is with methods like setTimeout"
Whisper Note
Eh, I still prefer bind for clarity, but arrows do make the code shorter.
Text Highlight2026-07-19 12:57:44
Original Highlight Excerpt
"Perhaps the greatest benefit of using arrow functions is with methods like setTimeout"
Whisper Note
Totally agree, arrow functions save me so much headache with setTimeout scope issues.
Text Highlight2026-07-19 10:03:44
Original Highlight Excerpt
"An empty arrow function returns undefined"
Whisper Note
I remember porting that to a regular function and getting confused for a sec.
Text Highlight2026-07-19 09:54:44
Original Highlight Excerpt
"An empty arrow function returns undefined"
Whisper Note
Wait, so `const empty = () => {};` returns undefined? That's weird.
Text Highlight2026-07-19 09:45:44
Original Highlight Excerpt
"An empty arrow function returns undefined"
Whisper Note
Haha, that's a classic gotcha for beginners, empty braces are not a no-op.
Share this page's whispers
Short link
https://domwhisper.com/s/28c16bfce1a3Embed snippet
<iframe src="https://domwhisper.com/embed/28c16bfce1a3" width="100%" height="480" style="border:0;border-radius:16px" loading="lazy"></iframe>See what people are discussing on developer.mozilla.org
Install DomWhisper to view live whispers as you browse, and join the discussion.
Get the extension