Why use find method in lodash?

  • 0
    I just can't understand why they use some of the methods from the 'lodash' library if the native ones work much faster? Benchmark example .
    JavaScript Anonymous, Jul 8, 2019

  • 1 Answers
  • 0
    Personally, I see three pluses:

    1. This method works with collections, so you can use `find` to find values ​​in a dictionary, for example` _.find ({a: {name: 'First'}, b: {name: 'Second'}}, (user ) = & gt; user.name === 'Second') `.

    2. Since the method works with collections, you can pass both an array and an object, it may sometimes be required.

    3. Convenient to use in functional programming for forming call chains
    Anonymous

Your Answer
To place the code, please use CodePen or similar tool. Thanks you!