我有这个JSON:
"data"{
"names": ["alfred","anthony","mary","john"],
"cities": ["nyc","paris", "berlin"]
}
我想要这个,但是JSON中的数组高度取决于里面有多少数据:
names : alfred,
anthony,
mary,
john
cities : nyc,
paris,
berlin
有什么主意吗?
答案 0 :(得分:0)
var data ={
"names": ["alfred","anthony","mary","john"],
"cities": ["nyc","paris", "berlin"]
}
data.names.join('\n');