frontend/src/helpers/find.ts

3 lines
130 B
TypeScript

export function findIndexById(array : [], id : string | number) {
return array.findIndex(({id: currentId}) => currentId === id)
}