Skip to content
Advertisement

How to recursively process a JSON data and return the processed JSON from a function?

I have below JSON data with nested objects. I want to delete the ‘id’ from this structure and return the changed JSON from the function. I have tried to do it recursively below way but not able to return the changed JSON.

JavaScript

How can I return the rest of the JSON from the processJSON() and hold that in a variable ? Secondly, is this the correct way to do it recursively ?

Thanks.

Advertisement

Answer

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