json - Get information from a JavaScript object that has a number as an index -


this question has answer here:

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

Popular posts from this blog

java - SSE Emitter : Manage timeouts and complete() -

jquery - uncaught exception: DataTables Editor - remote hosting of code not allowed -

java - How to resolve error - package com.squareup.okhttp3 doesn't exist? -