Typescript, Generics, Polymorphism.
(result.data?.name) { return result.data.name; } if (result.error) { console.error('Error fetching user:', result.error); } } getUserName(); Here we can see a multi-purpose function fetchData. It can fetch data of any data structure we want but some specific users of the function can depend on the