欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

js 二维json数组push 创建方法

程序员文章站 2022-03-23 08:43:19
?var GZData=[];? 创建方法 ?GZData.push([{ name: '广州'}, {name'清远', value:5}])...

?var GZData=[];?

创建方法

?GZData.push([{ name: '广州'}, {name'清远', value:5}]);

var GZData = [
? ??
? ? [{name:'广州'},{name:'清远',value:5}],
? ? [{name:'广州'},{name:'韶关',value:15}],
? ? [{name:'广州'},{name:'湛江',value:10}],
? ? [{name:'广州'},{name:'梅州',value:8}],
? ? [{name:'广州'},{name:'河源',value:5}],
? ? [{name:'广州'},{name:'肇庆',value:15}],
? ? [{name:'广州'},{name:'惠州',value:10}],
? ? [{name:'广州'},{name:'茂名',value:8}],
? ? [{name:'广州'},{name:'江门',value:5}],
? ? [{name:'广州'},{name:'阳江',value:15}],
? ? [{name:'广州'},{name:'云浮',value:10}],
? ? [{name:'广州'},{name:'汕尾',value:8}],
? ? [{name:'广州'},{name:'揭阳',value:5}],
? ? [{name:'广州'},{name:'珠海',value:15}],
? ? [{name:'广州'},{name:'佛山',value:10}],
? ? [{name:'广州'},{name:'潮州',value:8}],
? ? [{name:'广州'},{name:'汕头',value:5}],
? ? [{name:'广州'},{name:'深圳',value:15}],
? ? [{name:'广州'},{name:'东莞',value:10}],
? ? [{name:'广州'},{name:'中山',value:8}]
];