Seeking an uncomplicated method to thoroughly clean basic property values directly on an object, as shown in the example below:
var filled = {
levelOneObj: {
property: 'primitive',
levelTwoObj: {
property: 'primitive value'
},
levelTwoArray: ['primitive', 123]
}
}
cleanPrimitives(filled);
var filled = {
levelOneObj: {
levelTwoObj: {
},
levelTwoArray: []
}
}
I'm hoping to avoid unnecessary complexity and am open to any pre-existing solutions or assistance that may already exist in a library-- thank you for your help!