From aedcfa2d0551270219d227b6742e839aa2dddec9 Mon Sep 17 00:00:00 2001 From: sivalaxman7 <106509946+sivalaxman7@users.noreply.github.com> Date: Fri, 18 Nov 2022 00:05:31 +0530 Subject: [PATCH] fix(curriculum): changed filter description (#48524) * changed filter description * review change * build * file --- .../use-the-filter-method-to-extract-data-from-an-array.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/functional-programming/use-the-filter-method-to-extract-data-from-an-array.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/functional-programming/use-the-filter-method-to-extract-data-from-an-array.md index a2ada46d8cc..cf4b07d73df 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/functional-programming/use-the-filter-method-to-extract-data-from-an-array.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/functional-programming/use-the-filter-method-to-extract-data-from-an-array.md @@ -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.