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.

  1. Use the .find() method.
  2. Return the very first name that has exactly 5 characters.

01EXAMPLE 1

Inputnames = ["Ali", "Sarah", "Bob"]
Output"Sarah"

Constraints

  • Use the .find() method.
CoreArraysMethods
JavaScript
Loading...
3 Hidden

Input Arguments

names["Ali","Sarah","Bob"]

Expected Output

Sarah

Click RUN to test your solution