I have been trying to figure out how to simply search and replace a value (in this case replacing any value equal to null with undefined) in an array of objects like this - the array keys could vary:
var array = [{
"name": "mike",
"age": null
},
{ "name": "jim",
"age": 99
}];
Expected result:
var array = [{
"name": mike,
"age": undefined
},
{ "name": jim,
"age": 99
}];
My impression is that I should be able to do this using the map() function but none of the documentation examples are quite making sense to me for this. I have been trying to apply the solution from this question: https://stackoverflow.com/a/5915891/2930969 but without any success.
Anyways, if anyone cares to help point me in the right direction here is a framed out codepen you can tinker with: http://codepen.io/anon/pen/zBxwdj?editors=0012
mikeandjimare undefined.