Skip to content
Advertisement

Modify array during multiple foreach loop iterations

I’ve to update data for array which has 4 foreach loops,

JavaScript

I want to update data of very deep 4th foreach loop, which isn’t updating data, where as first loop data update was possible.

i’ve tried to put “&” but in first loop it worked and in 4th loop it’s not working.

Any possible solutions ?

Advertisement

Answer

You have all keys, you can use these to modify your values :

JavaScript
User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement