I want to loop through the allData
and search if the id
matches 12345
,
I want to remove the Offer Object and insert the newOffer
Object
$(document).ready(function () {
var newOfferToInsert = {
"id": "12345",
"name": "ssfd Offer"
}
var idToSearch = '12345'
var allData = [{
"id": {
"Street": "555 92nd St S",
"id": "12345"
},
"Offer": {
"id": "12345"
}
}, {
"id": {
"Street": "666 DFTYY",
"id": "345"
},
"Offer": {
"id": "345"
}
}];
});