Monday, 9 September 2013

Parse out a object attribute inside of an array

Parse out a object attribute inside of an array

I'm trying to parse out the value from iso_code, here is what I have so far.
JSON.stringify(location.subdivisions, undefined, 4)
I can get the whole subdivisions array, but I'm not sure how to get the
iso_code.
"subdivisions": [
{
"iso_code": "FL",
"names": {
"en": "Florida",
"zh-CN": "·ðÂÞÀï´ïÖÝ",
"fr": "Floride",
"pt-BR": "Fl¨®rida",
"ja": "¥Õ¥í¥ê¥ÀÖÝ",
"es": "Florida",
"ru": "§¶§Ý§à§â§Ú§Õ§Ñ"
},
"geoname_id": 4155751
}
]

No comments:

Post a Comment