---
title: "Discussion on \"Object destructuring in TypeScript\" | Hashnode"
description: "Discussion on \"Object destructuring in TypeScript\". The cool part about TypeScript is that we can define types for certain variables.\nHowever, there is a scenario that might prove a bit difficult.\nAnd this is destructuring an object.\nLet's take the following example:\nconst user = {firstname: 'Chris', ..."
url: "https://hashnode.com/posts/object-destructuring-in-typescript/6215ced02c936b90065dc859"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Object destructuring in TypeScript](https://h.daily-dev-tips.com/object-destructuring-in-typescript?utm_source=hashnode&utm_medium=feed)

The cool part about TypeScript is that we can define types for certain variables. However, there is a scenario that might prove a bit difficult. And this is destructuring an object. Let's take the following example: const user = {firstname: 'Chris', ...

Feb 23, 2022 · 2 min read · h.daily-dev-tips.com  
Read the article

-   [#typescript](https://hashnode.com/tag/typescript)
-   [#javascript](https://hashnode.com/tag/javascript)
-   [#beginners](https://hashnode.com/tag/beginners)

## Written by

[Chris Bongers](https://hashnode.com/@dailydevtips)

@dailydevtips · Cape Town, SA

  
[View profile](https://hashnode.com/@dailydevtips)

Looking to get into development? As a full-stack developer I guide you on this journey and give you bite sized tips every single day 👊

I'm a full-stack developer from South Africa 🇿🇦. I love writing about JavaScript, HTML and CSS.

## Responses 1

Markdown supported · ⌘↵ to post

[James 'Dante' Midzi](https://hashnode.com/@Psypher1)

[Feb 23, 2022](https://hashnode.com/posts/object-destructuring-in-typescript/6215ced02c936b90065dc859/comment/621679cc3b11209c8fb4c032)

I spent a good 3 hours trying to figure out why my site wasn't deploying.

I thought of Typescript during that time, and even more when I found out what the issue was

[Chris Bongers](https://hashnode.com/@dailydevtips)

[Feb 24, 2022](https://hashnode.com/posts/object-destructuring-in-typescript/6215ced02c936b90065dc859/comment/621679cc3b11209c8fb4c032#reply-621732c03b11209c8fb4ce7d)

Was it something that TypeScript would have caught? It can really help showing errors early on.

[James 'Dante' Midzi](https://hashnode.com/@Psypher1)

[Feb 24, 2022](https://hashnode.com/posts/object-destructuring-in-typescript/6215ced02c936b90065dc859/comment/621679cc3b11209c8fb4c032#reply-621766523b11209c8fb4d441)

Yes it was. The moment didit3,Typescript would havewarmedme. I had some values missing from a function but it was working
