数组中的对象是否存在这个值

 let value = {
        id: 1,
        name: 'eee'
      }
      let multipleTable = [
        { id: 1, name: 'a' },
        { id: 2, name: 'b' },
        { id: 3, name: 'c' },
        { id: 4, name: 'd' },
        { id: 5, name: 'e' },
      ]
      var index = multipleTable.findIndex(item => item.id === value.id)

你可能感兴趣的:(前端,linux,javascript)