var a = {name:‘hehe‘,age:10};
qs.stringify(a)
// ‘name=hehe&age=10‘
JSON.stringify(a)
// ‘{"name":"hehe","age":10}‘
var a = ‘{name:"hehe",age:10}‘;
qs.parse(a)
//{ ‘{name:"hehe",age:10}‘: ‘‘ }
var c = ‘{name:"hehe",age:"10"}‘;
JSON.parse(c)
//{ name: ‘hehe‘, age: ‘10‘ }
var a=[{a:123},{a:345}]
qs.stringify(a)
//‘0[a]=123&1[a]=345‘
时间: 2024-10-15 02:42:05