json - Get information from a JavaScript object that has a number as an index -
this question has answer here:
- unable access json property “-” dash 1 answer
how can retrieve information javascript object has numeric value index?
"element_count": 69, "near_earth_objects": { "2016-10-29": [ ... ]
i need access data inside "2016-10-29"
array.
i have no problem accessing other elements this:
$.getjson(call, function(data1){ console.log(data1.element_count); });
like mix notation , retrieve sub-array element in property of json object :
var data = { "element_count": 69, "near_earth_objects": { "2016-10-29": ["subelement1", "subelement2", "subelement3"], "2016-10-30": ["subelement11", "subelement12", "subelement13"] } }; console.log(data.near_earth_objects["2016-10-29"][1]);
Comments
Post a Comment