【发布时间】:2016-01-24 10:03:56
【问题描述】:
场景:我有一个变量 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.a1like 的所有值的数组
['b1', 'b2', 'b3']
【问题讨论】:
-
all the vaues of order.orderdetails.a1...order.orderdetails.a1将是未定义的 -
@jaromandaX a1 的所有值表示,a1 的值在数组 orderdetails 中
标签: javascript node.js underscore.js lodash