【发布时间】:2020-10-23 11:57:13
【问题描述】:
假设我有这种类型的数据结构:
{
"foo": [{state: on}, {state: off}, {state: on}],
"bar": [{state: off}, {state: off}, {state: on}],
"baz": [{state: on}, {state: on}, {state: on}]
}
如何以优雅的方式过滤嵌套的哈希数组,以便找回:
{
"foo": [{state: on}, {state: on}],
"bar": [{state: on}],
"baz": [{state: on}, {state: on}, {state: on}]
}
【问题讨论】: