Array find Fill
Fill in the Blank Easy
Question
Fill in the blank to find the first number greater than 10.
Code
const nums = [5, 12, 8, 130, 44];
const found = nums.___(n => n > 10);
console.log(found);
Hint
Use the method that returns the first matching element.
Explanation
find returns the first element in the array that satisfies the callback predicate. From [5, 12, 8, 130, 44], the first element greater than 10 is 12, so found is 12. Unlike filter, find returns a single value, not an array.
Related Resources
Related Lessons
- JavaScript Arrays
Learn about find.
Related Reference
- JavaScript Array Reference
Reference for find.
Look up unfamiliar terms
A beginner-friendly glossary explains jargon in plain English — variables, functions, DOM, Promise, and more.
Decode error messages
Plain-English explanations of common errors — what they mean, why they happen, and how to fix them.
Build real projects
Apply what you learned by building guided projects with starter code and solutions.