I have one array logicalAddress which has 2 objects , now I have another object obj which has some value and I have to add in the array logicalAddress as new object or update the existing object . if orderNo is available in obj and its matching with any of the orderNo in array then it should update the complete object else it should add new obj. Please help . Getting confused .
logicalAddress
0:
orderNo: "AB1"
RelNo: "001"
denomination: "Testing"
lineNo: "09"
quantity: "4000"
1:
orderNo: "AB2"
RelNo: ""
denomination: "Testing"
lineNo: ""
quantity: "5000"
const obj ={
orderNo: "AB2"
RelNo: ""
denomination: "Testing"
lineNo: ""
quantity: "8000"
}