DEV Community

Discussion on: TypeScript: Object Destructuring

Collapse
 
rollergui profile image
Guilherme

Thanks for the post :)
And even though it's probably obvious, just in case someone was wondering (as I was), if you want to rename the variable, you have to type the original name in the object literal
const { model: carModel }: { model: string } = car;