在下面的代码中,JSONObject.length
是 2:
var JSONObject = [{
"name": "John Johnson",
"street": "Oslo West 16",
"age": 33,
"phone": "555 1234567"
}, {
"name": "John Johnson",
"street": "Oslo West 16",
"age": 33,
"phone": "555 1234567"
}];
但是,在下面的代码中,JSONObject.length
是未定义的。为什么?
var JSONObject = {
"name": "John Johnson",
"street": "Oslo West 16",
"age": 33,
"phone": "555 1234567"
};