I have been stumped by this looking for some direction. I have a state object:
const state = [
{type: 'Primary', number: 123456},
{type: 'Mobile', number: 789012}
]
I have a function which is giving me the updated values for the oldValue, newValue, and index.
How would I be able to replace the specific number value for example in the 'Mobile' object and return the new array?
state, using spread syntax,.splice()shallow copy by index inserting modified object and set state to modified arrayidproperty for each object and access those items byid.