mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2025-12-30 03:03:06 -05:00
fix(curriculum): changed filter description (#48524)
* changed filter description * review change * build * file
This commit is contained in:
@@ -10,7 +10,7 @@ dashedName: use-the-filter-method-to-extract-data-from-an-array
|
||||
|
||||
Another useful array function is `Array.prototype.filter()`, or simply `filter()`.
|
||||
|
||||
`filter` calls a function on each element of an array and returns a new array containing only the elements for which that function returns `true`. In other words, it filters the array, based on the function passed to it. Like `map`, it does this without needing to modify the original array.
|
||||
`filter` calls a function on each element of an array and returns a new array containing only the elements for which that function returns a truthy value - that is, a value which returns `true` if passed to the `Boolean()` constructor. In other words, it filters the array, based on the function passed to it. Like `map`, it does this without needing to modify the original array.
|
||||
|
||||
The callback function accepts three arguments. The first argument is the current element being processed. The second is the index of that element and the third is the array upon which the `filter` method was called.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user