🌐
PHP
php.net › manual › en › function.array-filter.php
PHP: array_filter - Manual
Note that a filtered array no longer encodes to json arrays, as the indices are no longer continuous: $a = ['a', 'b', 'c']; var_dump(json_encode($a)); // ["a","b","c"] $a = array_filter($a, function ($x) { return $x == 'b'; }); var_dump(json_encode($a)); // {"1": "b"} you can use array_values get a continuous array var_dump(json_encode(array_values($a))); // ["b"]
🌐
npm
npmjs.com › package › array-filter
array-filter - npm
Array#filter for older browsers.. Latest version: 1.0.0, last published: 11 years ago. Start using array-filter in your project by running `npm i array-filter`. There are 309 other projects in the npm registry using array-filter.
      » npm install array-filter
    
Published   May 18, 2015
Version   1.0.0
Author   Julian Gruber
Discussions

How do I implement a fast way to filter a large array of 20k objects?
I’m building an Ionic app. The app contains an array of 20k “word” objects with the word and pronunciation. This data is all local and is used via a service. There’s a search page with a search input that on keydown makes a new search request and updates the “DOM.” The time it takes ... More on forum.ionicframework.com
🌐 forum.ionicframework.com
0
February 2, 2018
Filter an item in array if it includes search term (contains) & only get first match
Hi, I’m looking for a bit of help. I am trying to get a single value from an array if the item includes a search trem. Note, it does not have to be exactly equal to, but should contain the variable. I have the followin… More on community.make.com
🌐 community.make.com
1
0
February 6, 2023
Filter pipe for multiple fields with nested array

you need to iterate over the listOfItems array from within the filter function - find will do it for you. i can't remember the exact syntax for pipes off the top of my head but here's a function that should do what you want:

specialSearch(obj) {
    myArray.filter(entry => {
        return entry.name === obj.name && entry.listOfItems.find(item => item.description === obj.description);
    });
}

so we only allow entries in the top-level array that both have a name matching the name we input, but we must also find an item in listOfItems that has a description matching the description we input.

More on reddit.com
🌐 r/Angular2
3
1
October 6, 2016
A slightly faster array filter
I see that you have moved away from searching for 'w', but I was wondering if you were only focused only on the 'Where' capabilities? On my system (PowerShell 5.1) this seems to go faster than your 'Where' and 'Class' examples measure-command { foreach ($i in 0..1kb) { foreach($item in $files){if([char]$item.Name[0] -match 'w') {$item}} } } | Select-Object -ExpandProperty TotalMilliseconds Your example times on my system (far fewer 'w' files than you): 303.2 265.6 My example 189.2 More on reddit.com
🌐 r/PowerShell
11
9
December 10, 2018
🌐
W3Schools
w3schools.com › php › func_array_filter.asp
PHP array_filter() Function
The array_filter() function filters the values of an array using a callback function.
🌐
Scrimba
v1.scrimba.com › articles › react-filter-list
How to use Array.filter to narrow down a list in React
December 17, 2022 - This is easily done using the Array.filter method! How Does Array.filter Work? 🤔The Array.filter method takes an array of items and returns a completely new array that only contains the elements from the original array
🌐
Codecademy
codecademy.com › docs › javascript › arrays › .filter()
JavaScript | Arrays | .filter() | Codecademy
July 29, 2025 - JavaScript’s array.filter() method creates a new array containing only the elements from the original array that pass a test implemented by a provided function.
🌐
DEV Community
dev.to › oculus42 › javascript-arrays-filter-4fe5
JavaScript Arrays: Filter - DEV Community
January 24, 2025 - The .filter() function takes a predicate – a function that returns true or false. In .map() we get the return value of the mapper function; with .filter() we use the return value of the predicate to determine if the value will appear in the new result array.
🌐
Go Make Things
gomakethings.com › why-would-you-use-array.some-or-array.every-over-array.filter
Why would you use Array.some() or Array.every() over Array.filter() | Go Make Things
June 7, 2018 - Array.filter() returns a new array of items, removing any from the original array that don’t match some criteria you specify as part of a callback function.
Find elsewhere
🌐
Playwright
playwright.dev › locator
Locator | Playwright
Returns an array of node.textContent values for all matching nodes.
🌐
JavaScript in Plain English
javascript.plainenglish.io › javascript-filtering-arrays-filter-method-ac582e4594e2
JavaScript: Filtering Arrays with the Filter() Method | by Oleg Ivanov | JavaScript in Plain English
August 27, 2021 - You are given an array of strings and need to return a new array of strings, where each element / or string is more than 6 letters. The method Filter () is called on the array / words and returns the new array of elements, each more than 6.
🌐
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.
🌐
Yogesh Chavan
blog.yogeshchavan.dev › a-complete-introduction-to-javascript-array-filter-method
A Complete Introduction to JavaScript Array filter Method
July 29, 2021 - The filter method returns an array containing only those elements for which the callback function returns a true value. You can see the current value of the element that is passed to the callback function in each iteration of the loop If you ...
🌐
TutorialsPoint
tutorialspoint.com › filter-array-with-filter-and-includes-in-javascript
Filter array with filter() and includes() in JavaScript
In this article, using the filter() and includes() methods in JavaScript, we can filter an array based on the elements presence in another array or specific conditions. For suppose we have two arrays as array1 and array2. we want to filter array1 to
🌐
Mike Bifulco
mikebifulco.com › home › javascript tips: using array.filter(boolean)
JavaScript Tips: Using Array.filter(Boolean) | Mike Bifulco
November 12, 2021 - If you come across array.filter(Boolean) in JavaScript code, never fear! It's a handy bit of functional programming that cleans up arrays with null and undefined values in them.
🌐
Mimo
mimo.org › glossary › javascript › filter
Master JavaScript Filter Operator: Apply Filter Arrays
The JavaScript filter() method creates a new array with all elements that pass the test implemented by the provided function.
🌐
Ionic Framework
forum.ionicframework.com › ionic framework › ionic-v3
How do I implement a fast way to filter a large array of 20k objects? - ionic-v3 - Ionic Forum
February 2, 2018 - I’m building an Ionic app. The app contains an array of 20k “word” objects with the word and pronunciation. This data is all local and is used via a service. There’s a search page with a search input that on keydown makes a new search request and updates the “DOM.” The time it takes ...
🌐
daily.dev
daily.dev › home › blog › get into tech › filter arrays in javascript: a primer
Filter Arrays in JavaScript: A Primer
December 22, 2025 - Looking to sift through your JavaScript arrays and pull out only what you need? The filter() function is your go-to tool.
🌐
W3Schools
w3schools.com › jsref › jsref_filter.asp
W3Schools.com
The filter() method creates a new array filled with elements that pass a test provided by a function.
🌐
GameMaker
manual.gamemaker.io › monthly › en › GameMaker_Language › GML_Reference › Variable_Functions › array_filter.htm
array_filter
This function returns a new array that is the filtered version of the given array (or a range of it).
🌐
React
react.dev › learn › rendering-lists
Rendering Lists – React
You can use JavaScript’s filter() method to return just those people. 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).