The _.filter() is used to check which elements in the passed array satisfy the condition. It will form a new array of all those elements which satisfy the condition passed from the array. This function takes the element from the list one by one and checks the specified operations on the code.
Syntax: _.filter( list, predicate, [context] ) Parameters: This function accept three parameters as mentioned above and described below:
list: This parameter is used to hold the list of items.
predicate: This parameter is used to hold the truth condition.
context: The text content which need to be display. It is optional parameter.
Return value: It returns an array consisting of elements which satisfy the condition.