Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

update array of object using other array javascript

arra1 = arra1.map(item => {
  let item2 = arra2.find(i2 => i2.transid === item.transid);
  return item2 ? { ...item, ...item2 } : item;
});
 
PREVIOUS NEXT
Tagged: #update #array #object #array #javascript
ADD COMMENT
Topic
Name
2+3 =