DEV Community

Jack Pritom Soren
Jack Pritom Soren

Posted on

4 2

JavaScript Array Methods : Find()

The find() method returns the first element in the provided array that satisfies the provided testing function. If no values satisfy the testing function, undefined is returned.

const array1 = [5, 12, 8, 130, 44];

const found = array1.find(element => element > 10);

console.log(found);
//output: 12
Enter fullscreen mode Exit fullscreen mode

Find

Follow me on : Github Linkedin

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs