I have an array of objects. I have this code that finds an object in array. My question is when the object is found, how do I update it?
$(document).on("change", "input[name=ActualFinish]", function () {
var job = $(this).parent().parent().find('input[name=Job_No]').val();
var actualFinish = $(this).parent().parent().find('input[name=ActualFinish]').val();
var task = $(this).parent().parent().find('input[name=LibrayTaskID]').val();
if (updatingData.find(x => x.Job == job && x.TaskID == task)) {
console.log("found. How do I update Date1?");
}
else {
updatingData.push({ Job: job, TaskID: task, Date1: actualFinish });
}
console.log(updatingData);
});