I wonder if it would be possible for me to employ a recursive function to read all the attributes and properties of an object including the nested properties and such. for example, if I have an object:
var mObj = {};
mObj.countries = [];
mObj.country = {};
mObj.country.states = [];
mObj.country.state = {};
mObj.country.state = {};
I am sure you get the picture. If it was just a simple object then I can employ "for in" loop, and perhaps nested "for in" loop, an object has numerous nested levels then using nested "for in" loops becomes somewhat chaos. I thought it would wonderful to employ recursion. Any help insight to this would highly appreciated.
Thank you.