I have an object which contains multiple arrays. I need to know the number of arrays in this object.
This is the code which creates the map object:
function parseXML(xData, Status){
var map = {}; //init the map
var web = $(xData.responseXML).find("Web");
for (var i = 0; i < web.length; i++) {
//we create a index for our links based on the depth of them by `/`
var m = web[i].attributes['Url'].value.substring(23, web[i].attributes['Url'].value.length).split('/').length;
map[m] = map[m] || []; //make sure we leave alone the old values if there is none init with new array
map[m].push(web[i].attributes['Url'].value); //push new value to node
}
console.log(map);
createNav(map);
}
I've tried:
console.log('there are '+map.length+"levels in this site"); but I get map.length = undefined.