[]是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"}‘
时间: 2024-10-18 22:56:10