← JavaScript Foundations
12 / 26
Lesson 12 — find / some / every
Asking questions about an array
Three methods answer common questions:
find(test)— the first item that passes, orundefined;some(test)—trueif at least one item passes;every(test)—trueonly if all items pass.
[15, 22].find((age) => age > 18); // 22
[15, 22].every((age) => age > 18); // false
Why it matters: "is anyone an admin?", "are all fields filled?" — these one-liners replace whole loops.
Want it another way?
Task
Use find to get the first adult, some to check for any admin, and every to check all are adults.
Run your code — when the output matches the task, you will see a green check. Then mark the lesson complete.
Test your knowledge
A quick 3-question quiz on this lesson — instant feedback.