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

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)

 

posted @ 2021-05-18 09:38  风花一世月  阅读(139)  评论(0编辑  收藏  举报