Similar Question:
I have a nested data structure / JSON, how can I access a specific value?
While working with the US Census API, I encountered a two-dimensional JSON array after making a request using jQuery.get(). The result (data) resembles the following:
[["P0010001","NAME","state","county","tract"], ["2703","Census Tract 4001.01","17","119","400101"], ["5603","Census Tract 4001.02","17","119","400102"], ["4327","Census Tract 4002","17","119","400200"]]
Although it appears to be a two-dimensional JavaScript array, I am unable to access it as one when attempting:
var population = data;
alert(population[1][0]);
Is there a way to convert this JSON array into a JavaScript array, or perhaps convert it into a string that can then be transformed into an array?