这个JSON结构是数组还是对象?

时间:2014-11-02 22:44:24

标签: javascript json

我尝试使用JavaScript解析JSON,但我无法弄清楚如何迭代此结构,因为我无法确定这是一个数组,一个对象还是一个对象包含一个数组。这是代码:

{
"noun":
    {
    "syn":
    ["trial","trial run","tryout","mental test","mental testing","psychometric        
    test","examination","exam","run","attempt","communicating","communication","cover","covering","effort","endeavor","endeavour","experiment","experimentation","mental measurement","natural covering","try"]
    },
"verb":
    {
    "syn":["prove","try","try out","examine","essay","screen","quiz","ascertain","be","check","determine","evaluate","find out","judge","learn","pass judgment","score","see","submit","take","undergo","watch"]
    }
}

1 个答案:

答案 0 :(得分:4)

{}表示JSON块是OBJECT。它有两个属性:nounverb。每个属性都有一个名为syn的属性,它是一个数组(由[]表示)。