I have this collection of objects:
const objects = [
{ id: '11', name: 'ron', surname: 'lesner', group: 'A' },
{ id: '12', name: 'don', surname: 'lesner', group: 'B' },
{ id: '13', name: 'ton', surname: 'lesner', group: 'A' },
]
I need to return the object with matching id using Lodash.
The following code returns undefined
:
_.find(object, id, 11);
I'm expecting this result:
{ id: '11', name: 'ron' , surname: 'lesner' , group: 'A' }