如何使用Java脚本从此字典访问字段1的值?

时间:2018-07-27 04:59:17

标签: javascript dictionary

如何使用javascript访问此字典中的字段1值?

   var a= "channel":
           {
            "latitude":"1.0",
            "longitude":"2.0",
            "field 1":"34"
            }

1 个答案:

答案 0 :(得分:0)

var x = {
  "channel": {
    "latitude": "0.0",
    "longitude": "0.0",
    "field 1": "Y"
  }
}

console.log(x["channel"]["field 1"])