I am working with an array of objects that looks like the following:
var data = [{
id: 1,
firstName: 'John',
secondName: 'Doe',
email: '<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="9ff5f0f7f1fbf0fadff2fef6f3b1fcf0f2">[email protected]</a>'}];
In my code, I have a function called update which prompts the user for an id and updates the data object with the same id using the values provided by the user. For example:
function update(firstName, lastName, email, id)
I am looking for a way to update the data array based on the id provided by the user and also return true if the specified id was found in the array.