![]() If find() doesn't find an element, it returns undefined. ![]() const predicate = v => v > 3 įind() is different from Lodash's filter() function because filter() returns all elements that match a condition, whereas find() returns the first element that matches a condition. `find()` executes `predicate` for every element in the array until // `predicate` returns true. The find () function operates on a collection, not an array, which means you can use it on objects too. In Node. If find () doesnt find an element, it returns undefined. The first element of a collection that matches the given predicate. find () is different from Lodashs filter () function because filter () returns all elements that match a condition, whereas find () returns the first element that matches a condition.
0 Comments
Leave a Reply. |