在json中使用方括号的目的是什么? [英] what is the purpose of using square brackets in json?
本文介绍了在json中使用方括号的目的是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我是json的新手.我见过的一些json示例在花括号内包含数据,而某些json示例在方括号内具有子数据.
I am new to json. Some json examples i have seen have data within the curly braces and some json examples have subdata within square brackets.
{
"glossary": {
"title": "example glossary",
"GlossDiv": {
"title": "S",
"GlossList": {
"GlossEntry": {
"ID": "SGML",
"SortAs": "SGML",
"GlossTerm": "Standard Generalized Markup Language",
"Acronym": "SGML",
"Abbrev": "ISO 8879:1986",
"GlossDef": {
"para": "A meta-markup language, used to create markup languages such as DocBook.",
"GlossSeeAlso": ["GML", "XML"]
},
"GlossSee": "markup"
}
}
}
}
}
来自 http://json.org/example.html
在方括号内包含数据的需求/目的是什么?
What is the need/purpose of having data within the square brackets?
致谢
推荐答案
方括号产生列表/数组.
The square brackets produce a list/array.
大括号会产生一个具有键/值对的对象.
The curly brackets produce an object with key/value pairs.
然后列表可以是键/值对的值.
The list can then be a value of a key/value pair.
这篇关于在json中使用方括号的目的是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文