查询数组或者数组对象是否有对应的值

1     const index = this.addedlist.findIndex(item => item.name === row.name);
2     const obj = this.addedlist.find(item => item.name === row.name);
3     console.log("点击的是第",index)
4     console.log("点击的数据为",obj)

原文地址:https://www.cnblogs.com/fhysy/p/14779628.html