DEV Community

Jack Pritom Soren
Jack Pritom Soren

Posted on

5 2

JavaScript Array Methods : Filter()

The filter() method creates a new array with all elements that pass the test implemented by the provided function.

Example:

const words = ['spray', 'limit', 'elite', 'exuberant', 'destruction', 'present'];

const result = words.filter(word => word.length > 6);

console.log(result);
//Output: Array ["exuberant", "destruction", "present"]
Enter fullscreen mode Exit fullscreen mode

Filter

Top comments (2)

Collapse
 
andrewbaisden profile image
Andrew Baisden

These ES6 JavaScript Array Methods really make our work less tedious.

Collapse
 
jps27cse profile image
Jack Pritom Soren

Yes, ES6 has made our job easier.

Image of Docusign

🛠️ Bring your solution into Docusign. Reach over 1.6M customers.

Docusign is now extensible. Overcome challenges with disconnected products and inaccessible data by bringing your solutions into Docusign and publishing to 1.6M customers in the App Center.

Learn more