The Target Seeker
Easy+20 XP
Mission Briefing
The Detective needs exactly one specific suspect. You've been given a list of names, and you must find the very first person whose name length matches the clue.
The Concept: Finding Elements
The .find() method returns the value of the first element in the array that satisfies the provided testing function. If it finds one, it stops searching!
The Objective
Your function receives an array names.
- Use the
.find()method. - Return the very first name that has exactly 5 characters.
01EXAMPLE 1
Input
names = ["Ali", "Sarah", "Bob"]Output
"Sarah"Constraints
- Use the .find() method.
CoreArraysMethods
JavaScriptSystem handles I/O — write your function only
Loading...
3 Hidden
Input Arguments
names["Ali","Sarah","Bob"]
Expected Output
Sarah
Click RUN to test your solution