i am using map method like below in typescript and react.
const final = result.map(({id,name}) => ({id, name}));
here i get type error "binding element id has implicitly any type" "binding element name has implicitly any type"
here id and name are string. how can i specify that here
i have tried doing
const final = result.map(({id: string, name:string}) => ({id, name}));
but this doesnt seem to be right.
could someone help me with this. thanks.
I am new to typescript.