Using JavaScript what’s the quickest way to recursively remove properties and values from an object?
A simple self-calling function can do it. function removeMeta(obj) { for(prop in obj) { if (prop === ‘$meta’) delete obj[prop]; else if (typeof obj[prop] === ‘object’) removeMeta(obj[prop]); } } var myObj = { “part_one”: { “name”: “My Name”, “something”: “123”, “$meta”: { “test”: “test123” } }, “part_two”: [ { “name”: “name”, “dob”: “dob”, “$meta”: { … Read more