find的作用:
find
方法主要是查找数组中的属性,会遍历数组 ,对每一个元素执行提供的函数,直到找到使该函数返回**true
** 的元素。然后返回该元素的值。如果没有元素满足测试函数,则返回**undefined
**。
基础使用:

运行效果:

实际开发:
一个数组invoiceList和后端传过来的数组list,list中的每一个对象插入到数组productlist,在插入之前需要判断invoiceList中每个对象的goodsOrgId和list每个对象中每个对象中的goodsOrgId是否相同,如果相同则不插入
代码:

运行效果:
