I'm converting certain properties from an object to an array.
const result = ({ a, b }: { a: string, b: number }) => [a, b]; // (string | number)[]
However, the standard way always returns an insufficient typescript type (string | number)[]
I have to always specify my output type for it to correctly type the result.
const result = ({ a, b }: { a: string, b: number }): [string, number] => [a, b]; // [string, number]
Is there a simpler way?