var data = {
"obj":[{
"name": "John",
"age": "10",
"Alias": "Person",
"where":[{"City1":"foo", "City2":"foo2"}]
},{
"name": "Mike",
"age": "",
"Alias": "Person",
"where":[{"City1":"test1", "City2":"test2"}]
}]
}
data.obj[0].Alias
和data.obj[1].Alias
是重複的。在JQuery中,如何檢查Json對象中的空值和重複值?
另外data.obj[1].age
爲空。
如果JSON對象中存在空值或重複值,則返回false。
如何檢查空值和重複值?
https://stackoverflow.com/questions/30735465/how-can-i-check-if-the-array-of -objects-have-duplicate-property-values - 這篇文章可能會幫助你:) –