JavaScriptオブジェクトをJSON文字列形式に変換します。データ構造をJSON文字列にシリアル化して保存または転送します。
Convert a basic JavaScript object into a JSON string.
{ name: "John", age: 30 }{
"name": "John",
"age": 30
}Convert an array containing different types of values into JSON.
[1, "hello", true, null, { x: 10 }][
1,
"hello",
true,
null,
{
"x": 10
}
]Convert an object to JSON with HTML characters escaped.
{
html: "<div>Hello & Welcome</div>",
message: "Special chars: > & ' \""
}{
"html": "<div>Hello & Welcome</div>",
"message": "Special chars: < > & ' ""
}