I am trying to use find function in this array
array= [{
type: 'banks',
id: 25,
attributes: { name: 'Bradescard', bankNumber: '063' },
links: { self: '/banks/63' }
},
{
type: 'banks',
id: 26,
attributes: { name: 'BM Goldman Sachs', bankNumber: '064' },
links: { self: '/banks/64' }
},
{
type: 'banks',
id: 27,
attributes: { name: 'Bracce', bankNumber: '065' },
links: { self: '/banks/65' }
}
]
if I try find(propEq('id', 27))(array) it returns the correct object, but I need to find by bankNumber.
I tried find(propEq(lensPath(['attributes', 'bankNumber']), '065'))(array) but I got undefined
How can I do this?