场景:我有一个变量 JSON
var json = {
"order": {
"orderDetails": [{
"a1": "b1",
"c1": "d1",
"e1": "f1"
}, {
"a1": "b2",
"c1": "d2",
"e1": "f2"
}, {
"a1": "b3",
"c1": "d3",
"e1": "f3"
}],
"orderHeader": [{
"a2": "b1",
"c2": "d1",
"e2": "f1"
}, {
"a2": "b2",
"c2": "d2",
"e2": "f2"
}]
}
};
我需要获取order.orderdetails.a1
的所有值的数组,例如:
['b1', 'b2', 'b3']
order.orderdetails.a1
的所有值都将是未定义的。 - Jaromanda X