How do I find an object in an array?

  • 0
    There is an array with objects:

    var list = [
      {
        name: 'Foo'
      },
      {
        name: 'Bar'
      },
      {
        name: 'Baz'
      }
    ]


    How can I find an object in an array with a certain name value?
    JavaScript Anonymous, Jun 1, 2019

  • 1 Answers
  • 0
    list.find ((item) = & gt; item.name === 'specific value')
    Anonymous

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