JSON Grammar
10 methodsJSON 的数据类型与语法规则,定义值、结构与转义。
{ "key": value, ... }对象:无序键值对集合,键必须是双引号字符串。
Parameters
| Name | Type | Description |
|---|---|---|
| key | string | 双引号包裹的字符串键 |
| value | any | 任意 JSON 值 |
Returns
一个 JSON 对象
Example
json
{
"name": "Alice",
"age": 30,
"active": true
}[ value, value, ... ]数组:有序值集合,值可为任意 JSON 类型。
Returns
一个 JSON 数组
Example
json
[1, 2, 3, 4, 5]
["apple", "banana", "cherry"]
[
{"id": 1, "name": "Alice"},
{"id": 2, "name": "Bob"}
]"text"