find and modify deeply nested object in javascript array
问题 I have an array of objects that can be of any length and any depth. I need to be able to find an object by its id and then modify that object within the array. Is there an efficient way to do this with either lodash or pure js? I thought I could create an array of indexes that led to the object but constructing the expression to access the object with these indexes seems overly complex / unnecessary edit1; thanks for all yours replies I will try and be more specific. i am currently finding