标签:
[]是Array
{}是Object
[]的key是int,{}的key是string
var a= Array();
a[a.length] = ‘3‘;
a[a.length] = ‘4‘;
a[a.length] = ‘5‘;
a toJSON 后 =‘["3", "4", "5"]‘
var a = new Object();
a[‘test1‘] = ‘3‘;
a[‘test2‘] = ‘4‘;
a[‘test3‘] = ‘5‘;
a toJSON 后 = ‘{"test1":"3", "test2":"4", "test3":"5"}‘
标签:
原文地址:http://www.cnblogs.com/ecosu/p/4305583.html