我想检查一个JSON对象中是否包含某个键(key)的特定值(value),比如说我想检查在任何对象中,键(key) "name" 是否具有值为 "Blofeld"(这是正确的)。我该怎么做?
[ {
"id" : 19,
"cost" : 400,
"name" : "Arkansas",
"height" : 198,
"weight" : 35
}, {
"id" : 21,
"cost" : 250,
"name" : "Blofeld",
"height" : 216,
"weight" : 54
}, {
"id" : 38,
"cost" : 450,
"name" : "Gollum",
"height" : 147,
"weight" : 22
} ]
obj.name === "Blofeld"
- VLAZArray.prototype.some()
- Andreas