How to do object destructuring with types in TypeScript?
Originally Published Here ๐!
Sometimes when you destructure object properties in TypeScript, you may want to define the type for the property you are destructuring.
TL;DR
// an object
const John = {
age: 23,
isAdult: true,
};
// get age propert...
melvingeorge-me.hashnode.dev2 min read