Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何从以下代码(JSON 结构)访问位置属性并在 Nodejs 中分配值。
{ pos : { lon : 30, lat : 30 } }
谢谢
如果您在字符串变量中有 JSON,则可以使用
var json = JSON.parse(theString);
然后通过
json.pos.lon;