【发布时间】:2021-08-17 19:38:16
【问题描述】:
我正在使用传单 1.7.1 并成功地从我的机器的本地内存中加载了 JSON 文件。 我有一个看起来像这样的对象:
covid = {"AFG":{"continent":"Asia","location":"Afghanistan","population":38928341.0,"population_density":54.422,"median_age":18.6},
"KOR":{"continent":"Asia","location":"Afghanistan","population":38928341.0,"population_density":54.422,"median_age":18.6},
"KGZ":{"continent":"Asia","location":"Afghanistan","population":38928341.0,"population_density":54.422,"median_age":18.6},
....}
我想做的是通过 ISO 国家代码(例如 KOR、KGZ 等)获取国家/地区。 即使在转换为目标文件后,我也无法通过 covid[0] 之类的索引获得,但它不起作用。 我是 JS 新手,无法真正处理数据。
【问题讨论】:
标签: javascript json parsing