Functional JavaScript Programming 10 - Filter( ) Method (WITH EXAMPLE)

preview_player
Показать описание

What is Filter( ) Method in JavaScript?
How to get started in Functional Programming on JavaScript?

In this video tutorial, I talk about the basics of Functional Programming by bringing in the Filter( ) Method. What is it? Find out in the video.

FILTER( ) FUNCTION
===================

1. Used to take elements out of an array
2. The callback used here is a boolean
3. As with map() function, a new array is created here
4. The callback function is used to test each element here
5. If the individual element passes the condition set by the callback function, then a true value is assigned to it
6. The elements that receive a false value do not make it to the new array created
7. Pure function - so the old array is left untouched
8. It finds application in a lot of programs, starting from filtering results in a search

Filter( ) Method in Functional JavaScript Programming by Rocky DeRaze (WITH EXAMPLE)
Рекомендации по теме