I have a array as follows
data = [
{
sNo:1,
month:[
{
id:1,
value:0
},
id:5,
value:10
},
{
sNo:2,
month:[
{
id:6,
value:10
},
id:9,
value:20
}
]
I have a method as follows:
myMethod(value,sNo,indexOfMonthArray) {
}
this method receives three aruguments. one is value to be updated, second is sNo and third is index of inner month array where value needs to be updated. I want to search of sNo in data array and for that particular sNo, in month array I need to update value which I am recieving in argument. How can I do that?