I have multiple arrays of objects coming from an API
They are all the same except they have different property name for an id to match with types
f.e.
id: 1,
value: true,
name: 'Something1',
carTypeId: 1
}
const plane = {
id: 1,
value: true,
name: 'Something2',
planeTypeId: 1
}```
So I need a Type object for this, a generic probablt
And then I need to be able to send an array of one these types into a function and be able to access the TypeId property
So I'm assuming a Generic function as well, but that doesn't seem to work.
Here is playground I tried