Array.prototype.find() - JavaScript | MDN
5
Public whispers
5
Contributors
2026-07-19 09:18:27
First whispered
Public whispers on this page
Text Highlight2026-07-19 12:39:27
Original Highlight Excerpt
"Empty slots in sparse arrays are visited, and are treated the same as undefined."
Whisper Note
Huh, I always thought it'd just skip them. Good to know.
Text Highlight2026-07-19 12:30:27
Original Highlight Excerpt
"Empty slots in sparse arrays are visited, and are treated the same as undefined."
Whisper Note
Wait so holes count as undefined? That changes how I debug my code.
Text Highlight2026-07-19 09:36:27
Original Highlight Excerpt
"The following example returns the first element in the array that is a prime number, or undefined if there is no prime number."
Whisper Note
That's basically my go-to trick for finding stuff in arrays.
Text Highlight2026-07-19 09:27:27
Original Highlight Excerpt
"The following example returns the first element in the array that is a prime number, or undefined if there is no prime number."
Whisper Note
Wish they'd show a non-prime example too, but okay.
Text Highlight2026-07-19 09:18:27
Original Highlight Excerpt
"The following example returns the first element in the array that is a prime number, or undefined if there is no prime number."
Whisper Note
I always forget it returns undefined and not null, good reminder.
Share this page's whispers
Short link
https://domwhisper.com/s/b69ad6fb53dbEmbed snippet
<iframe src="https://domwhisper.com/embed/b69ad6fb53db" 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