I have recently jumped into the world of jQuery. I saw the methods find()
and filter()
but can not figure out the difference between the two.
find()
find()
returns the descendants of the selected elements that match the selector.
From the doc:
Description: Get the descendants of each element in the current set of matched elements, filtered by a selector.
filter()
filter()
filters the elements based on the selector or the provided function.
From the doc:
Description: Reduce the set of matched elements to those that match the selector or pass the function's test.