Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.9k views
in Technique[技术] by (71.8m points)

js数组格式处理~~

[
    {
  "GDP(万元)": "2019",
 "进出口总额(万美元)": "170266800",
 "财政收入(万元)": "无",
 "居民消费价格指数": "23476000",
 "第一产业占GDP比重(%)": "102.7",
 "第二产业占GDP比重(%)": "4.84369237",
 "第三产业占GDP比重(%)": "43.77300801"
},
{
  "GDP(万元)": "2018",
 "进出口总额(万美元)": "168181100",
 "财政收入(万元)": "2077473",
 "居民消费价格指数": "22926982",
 "第一产业占GDP比重(%)": "101.8",
 "第二产业占GDP比重(%)": "4.403824211",
 "第三产业占GDP比重(%)": "42.15212054"
},
]

上面的数据能处理成这种形式吗?

[
    [2019,2018],
    [170266800,168181100],
    ....
]

求各位大佬指教~


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

写个循环处理一下就好,还是你想知道有没有啥奇技淫巧


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...