🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Global_Objects › Array › filter
Array.prototype.filter() - JavaScript | MDN
December 13, 2025 - The filter() method of Array instances creates a shallow copy of a portion of a given array, filtered down to just the elements from the given array that pass the test implemented by the provided function.
🌐
W3Schools
w3schools.com › jsref › jsref_filter.asp
JavaScript Array filter() Method
The filter() method creates a new array filled with elements that pass a test provided by a function.
🌐
GitHub
github.com › zloirock › core-js
GitHub - zloirock/core-js: Standard Library
import 'core-js/actual'; Promise.try(() => 42).then(it => console.log(it)); // => 42 Array.from(new Set([1, 2, 3]).union(new Set([3, 4, 5]))); // => [1, 2, 3, 4, 5] [1, 2].flatMap(it => [it, it]); // => [1, 1, 2, 2] Iterator.concat([1, 2], function * (i) { while (true) yield i++; }(3)) .drop(1).take(5) .filter(it => it % 2) .map(it => it ** 2) .toArray(); // => [9, 25] structuredClone(new Set([1, 2, 3])); // => new Set([1, 2, 3])
Starred by 25.5K users
Forked by 1.7K users
Languages   JavaScript
🌐
Favtutor
favtutor.com › articles › javascript-array-filter
JavaScript Array Filter() Method (with Examples)
November 8, 2023 - The filter() function is a powerful array method in JavaScript that allows one to create a new array containing elements that satisfy a specific condition.
🌐
Mike Bifulco
mikebifulco.com › home › javascript tips: using array.filter(boolean)
JavaScript Tips: Using Array.filter(Boolean) | Mike Bifulco
November 12, 2021 - We're using a function built into arrays in JavaScript, called Array.prototype.filter, which creates a new array containing all elements that pass the check within the function it takes as an argument.
🌐
Anton Dev Tips
antondevtips.com › blog › how-to-filter-arrays-in-javascript-a-comprehensive-guide
How to Filter Arrays in JavaScript: A Comprehensive Guide
Array filtering in JavaScript allows you to create a new array from an existing one, containing only elements that match a given condition.
🌐
Flexiple
flexiple.com › javascript › javascript-filter-array
How to use the JavaScript filter array method? - Flexiple Tutorials - Flexiple
March 11, 2022 - A function or search criteria that would be used to filter values in the array · value - Required, the current element that needs to be filtered · index - Optional, in case you would like to start the iteration from a specific index ...
🌐
Adripofjavascript
adripofjavascript.com › blog › drips › filtering-arrays-with-array-filter.html
Filtering Arrays with Array#filter - A Drip of JavaScript
This allows you to create more complex filters that depend on the element's relationship with other elements, or the array as a whole.
Find elsewhere
🌐
Vultr Docs
docs.vultr.com › javascript › standard-library › Array › filter
JavaScript Array filter() - Filter Array Elements | Vultr Docs
November 28, 2024 - This method provides an efficient way to sift through arrays and select only those elements which meet the criteria you define, all without altering the original array. In this article, you will learn how to utilize the filter() function to ...
🌐
React
react.dev › learn › rendering-lists
Rendering Lists – React
This method takes an array of items, passes them through a “test” (a function that returns true or false), and returns a new array of only those items that passed the test (returned true).
🌐
Programiz
programiz.com › javascript › library › array › filter
Javascript Array filter()
Returns a new array with only the elements that passed the test. ... const prices = [1800, 2000, null, 3000, 5000, "Thousand", 500, 8000] function checkPrice(element) { return element > 2000 && !Number.isNaN(element); } let filteredPrices = prices.filter(checkPrice); console.log(filteredPrices); ...
🌐
GeeksforGeeks
geeksforgeeks.org › javascript › how-to-filter-object-array-based-on-attributes
How to Filter Object Array based on Attributes? - GeeksforGeeks
July 23, 2025 - One can use the filter() and reduce() functions in JavaScript to filter the object array based on attributes.
🌐
Ultimate Courses
ultimatecourses.com › blog › array-filter-javascript
Exploring Array Filter in JavaScript - Ultimate Courses
March 25, 2020 - Array Filter expects us to return an expression that will evaluate true or false, we can go straight to the finish line and make it easier by supplying literally true and false array values. I’m using JavaScript’s Boolean object to coerce the array element to a Boolean.
🌐
Tabnine
tabnine.com › home › how to use the array filter() method in javascript
How to Use the Array filter() method in JavaScript - Tabnine
July 25, 2024 - The filter() method filters an array according to provided criteria, returning a new array containing the filtered items. The Array object’s filter() method is an iteration method which enables us to retrieve all of an array’s elements that ...
🌐
Server Side Up
serversideup.net › blog › filter-sort-and-search-arrays-with-javascript
Filter, Sort, and Search Arrays with JavaScript | Server Side Up
October 4, 2022 - The first parameter is the value of the array as we iterate over it. The arrow is a callback function that returns true or false if the filter is matched. So if number % 2 == 0 then it's even and we return true. In most scenarios, you'd probably want to update a table, or make some UI changes. In straight JavaScript, you'd take the response from this method and use it to display the data instead of the full numbers array.
🌐
TutorialsPoint
tutorialspoint.com › filter-array-with-filter-and-includes-in-javascript
Filter array with filter() and includes() in JavaScript
January 28, 2025 - filter(): It is used to create a new array that includes only the elements that satisfy the condition provided by the callback function. includes(): Using includes(), the callback function checks if the element from array1 is present in array2. In JavaScript, a callback function is a function ...
🌐
GeeksforGeeks
geeksforgeeks.org › javascript › how-to-filter-an-array-of-objects-based-on-multiple-properties-in-javascript
How to Filter an Array of Objects Based on Multiple Properties in JavaScript ? - GeeksforGeeks
August 5, 2025 - The filter() method is a built-in array method in JavaScript that creates a new array with elements that pass the provided function's test.
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Global_Objects › Array › find
Array.prototype.find() - JavaScript | MDN
If you need to find if a value exists in an array, use includes(). Again, it checks each element for equality with the value instead of using a testing function. If you need to find if any element satisfies the provided testing function, use some(). If you need to find all elements that satisfy the provided testing function, use filter().