JavaScript的对象是一组由键-值组成的无序集合,例如:
var person = { name: 'Bob', age: 20, tags: ['js', 'web', 'mobile'], city: 'Beijing', hasCar: true, zipcode: null };
转化为JSON字符串要用JSON.stringify()方法。具体实例如下:
JavaScript的对象是一组由键-值组成的无序集合,例如:
var person = { name: 'Bob', age: 20, tags: ['js', 'web', 'mobile'], city: 'Beijing', hasCar: true, zipcode: null };
转化为JSON字符串要用JSON.stringify()方法。具体实例如下: