var _ = require("lodash");
var deepObj = {
"a":{
"b":{
"c":{
"d":1
},
"e":{
"f":"hello word"
}
}
}
};
var count = 0;
function getDepthOfData(data,depth){
if(depth>0){
depth = depth-1;
count++;
_.mapKeys(data,function(value, key){
console.log("depth="+(count)+"key="+key);
getDepthOfData(data[key],depth)
});
}
}
getDepthOfData(deepObj,4);