0
:ramdajs:項目定位與滿足內部數組給定的結構這樣的規格
[
{
documentType: { id: 4001 }
correspondence: [ { id: 1000 }, { id: 1010 } ]
},
{
documentType: { id: 102 }
correspondence: [ { id: 1000 } ]
},
{
documentType: { id: 101 }
correspondence: [ { id: 1001 } ]
}
]
我試圖用ramda找到數組的索引,其中內對應數組包含1000
我已經試過這樣:
R.filter(R.where({ correspondence: R.any(R.where({ id: 1000 }))}))(data)
shot chris,謝謝! – Jim