I have a JSON data set like this:
inputData = [
{ id : 179849, name : alex , lastname: sanchez},
{ id : 788539, name : Paul, lastname: bearer},
{ id : 282169, name : Jean, lastname: nobel},
...
{ id : 632785, name : Maria, lastname: parak}
]
I am looking to find an object based on its id value (for instance: 788539 )
and then change the value of its name attribute -> name becomes : bruno
The updated data would look like this:
resultData= [
{ id : 179849, name : alex , lastname: sanchez},
{ id : 788539, name : bruno, lastname: bearer}, /* UPDATED ENTRY*/
{ id : 282169, name : Jean, lastname: nobel},
...
{ id : 632785, name : Maria, lastname: parak}
]
What is the easiest way to filter / map my data in order to make this modification?