
Sponsored
Sponsored
Use these hints if you're stuck. Try solving on your own first.
Javascript has the concept of Proxy. That concept is critical to this problem.
You you need to keep track of which values in the JSON were overwritten with new values.
Somehow, keep a tree structure that exists parallel to the original object. This will keep track of all the edits.
When the mutator function is done. Return a clone with those mutations applied. It will be inefficient to clone the entire object so only clone the minimum number of nodes.