Qs. stringify and json. stringify are used and distinguished

Qs.stringify can be installed via NPM install QS is a package managed by the NPM repository. Qs.stringify () serializes the object as a URL, concatenated with &. JSON is a normal type of JSON, please compare the output

let ObjectDemo = {name:'weixin',age:12};
 qs.stringify(ObjectDemo)
// 'name=weixin&age=12'
JSON.stringify(ObjectDemo)
// '{"name":"weixin","age":12}'
Copy the code