Filter is used when we need to remove some elements from an array by some condition
It expects a function which returns boolean. If this function returns true
,
that means current element will be added to returned array. If this function returns false
, it wont.
Docs: