🌐
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
🌐
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
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
Javascript array.filter() - can someone please give me an example of the use of 'thisArg'?
IIRC, it's just a way to automatically bind your callback function to a given object should you need to for whatever reason. Say you wanted pass an object function to your filter, like Database.prototype.findUserByEmail. You could bind that to an existing instance of Database, or pass that instance as the thisArg and let filter do the binding internally. More on reddit.com
🌐 r/learnprogramming
10
1
February 28, 2022
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 7, 2016
🌐
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.
🌐
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"]
🌐
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 ...
🌐
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.
🌐
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.
Find elsewhere
🌐
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.
🌐
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.
🌐
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 ...
🌐
Reddit
reddit.com › r/learnprogramming › javascript array.filter() - can someone please give me an example of the use of 'thisarg'?
Javascript array.filter() - can someone please give me an ...
February 28, 2022 -

Trying to learn Javascript by example.

I'm looking at the array.filter() function with this syntax...

 array.filter(function(value[,index][,array])[,this]) 

...but I'm struggling to see a use-case for the optional argument 'this'.

Can anyone give me a suitable example, written in the functions basic form - no shorthand etc - to show me how I might use this argument. I realise that the use of 'this' is quite advanced for a beginner. So, say, I have an array and I want to pull out values over, say, 15

> var scores = [12,56,23,2,16];
> scores.filter(function(value){return value > 15});
< (3) [56, 23, 16]

...how would I use 'this' in this context or, if it's not a suitable context, what would be?

🌐
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.
🌐
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).
🌐
Esdiscuss
esdiscuss.org › topic › array-filter-max-number-of-matches
Array.filter: max number of matches?
Definitely, but it works without the slice(), too: var filtereds, items, limit, k; items = new Array(1000).join("-").split(""); limit = 3; k = 0; filtereds = items.filter(function( val, i, orig ) { if ( true ) { if ( ++k === limit ) { orig.length = 0; } return true; } }); console.log( filtereds ); // [ '-', '-', '-' ] Rick > > > /be > > > ______________________________**_________________ > es-discuss mailing list > es-discuss at mozilla.org > https://mail.mozilla.org/**listinfo/es-discuss<https://mail.mozilla.org/listinfo/es-discuss> > -------------- next part -------------- An HTML attachment was scrubbed...
🌐
Medium
medium.com › @cristi.nord › javascript-array-filter-method-f3d3e5d3af7d
JavaScript Array .filter() Method | by Sanje Qi | Medium
July 7, 2019 - The filter() method returns an array containing elements of the parent array that match the set test. A function containing a test is passed as an argument to the filter method.
🌐
Adripofjavascript
adripofjavascript.com › blog › drips › filtering-arrays-with-array-filter.html
Filtering Arrays with Array#filter
This allows you to create more complex filters that depend on the element's relationship with other elements, or the array as a whole.
🌐
Microsoft Community
techcommunity.microsoft.com › microsoft community hub › communities › products › microsoft 365 › excel
Filter array based on other filtered array as a lookup value | Microsoft Community Hub
September 9, 2023 - I have a list of schools that each have a unique ID number, and which I've associated together thanks to group numbers (so group 1 is three schools, with a unique ID number for each). So if I want to pull the schools which pertain to group 1 only, I'll filter that array and get those three schools' ID numbers.
🌐
freeCodeCamp
freecodecamp.org › news › javascript-filter-method
How the JavaScript Filter Method Works – Explained with Code Examples
February 15, 2024 - The filter method in JavaScript is designed as a higher-order function that iterates over each element of an array, allowing developers to apply a specific condition to filter out elements.