the backend gave me a json data format to pass over. There are still objects in the object. How to write
related codes
/ / Please paste the code text below (do not replace the code with pictures)
json format:
{
"cityid":"100003530",
"region":
{
"region":"123"
},
"cityname":"nihao"
}
if it is simple
{
"cityid":"100003530",
"region": "123",
"cityname":"nihao"
}
var obj={};
obj.cityid="100003530";
obj.region="123";
obj.cityname="nihao";
can I ask how to write something like the first one?