2022-01-06 18:14:37 +08:00

13 lines
311 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// 将js对象转换为字符串 output
var params = {
"username": "sfhfpc",
"password": "123456"
};
console.log(JSON.stringify(params));
// 将字符串转换为对象output
var params = '{"username":"sfhfpc","password":"123456"}';
console.log(JSON.parse(params), typeof(JSON.parse(params)));