---
title: "Discussion on \"TypeScript Best Practices #2 – Use More Precise Type Than ‘string’\" | Hashnode"
description: "Discussion on \"TypeScript Best Practices #2 – Use More Precise Type Than ‘string’\". Introduction\nThe best thing about typescript is that you can always start by using just the basic features of the language. You don't have to use every advanced feature of it right from the beginning. You can incrementally learn and implement stricte..."
url: "https://hashnode.com/posts/typescript-best-practices-2-use-more-precise-type-than-string-1/6149f3e920bcc6765ac0513c"
---

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

Discussion

# [TypeScript Best Practices #2 – Use More Precise Type Than ‘string’](https://harshitjain.hashnode.dev/typescript-best-practices-2-use-more-precise-type-than-string-1?utm_source=hashnode&utm_medium=feed)

Introduction The best thing about typescript is that you can always start by using just the basic features of the language. You don't have to use every advanced feature of it right from the beginning. You can incrementally learn and implement stricte...

Sep 21, 2021 · 4 min read · harshitjain.hashnode.dev  
Updated Oct 29, 2021  
Read the article

-   [#typescript](https://hashnode.com/tag/typescript)
-   [#clean-code](https://hashnode.com/tag/clean-code)
-   [#web-development](https://hashnode.com/tag/web-development)
-   [#frontend-development](https://hashnode.com/tag/frontend-development)
-   [#javascript](https://hashnode.com/tag/javascript)

## Written by

[Harshit Jain](https://hashnode.com/@harshitjain)

@harshitjain · Noida, India

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

Frontend @ Intuit | Ex MakeMyTrip, SAP | Javascript| Typescript | React | React Native | UI

I am a Frontend Engineer, based out of India, with 7+ years of building scalable web applications. I am passionate about clean code, design patterns, developer productivity and User Experience

## Responses 5

Markdown supported · ⌘↵ to post

[Rob Levin](https://hashnode.com/@agnosticui-guy)

[Sep 30, 2021](https://hashnode.com/posts/typescript-best-practices-2-use-more-precise-type-than-string-1/6149f3e920bcc6765ac0513c/comment/615535b09c8bfd08f5baa3ba)

Thanks for the write up! I would say that intersection types and extending are right up there with union types in terms of usefulness. How often do we have an interface we want to extend with just a couple of properties. This is a pretty good [article](https://codingblast.com/typescript-intersection-types/) on intersection types.

[Shawn Liu](https://hashnode.com/@HeyPachimari)

[Sep 23, 2021](https://hashnode.com/posts/typescript-best-practices-2-use-more-precise-type-than-string-1/6149f3e920bcc6765ac0513c/comment/614bead7544e242e0c93ddba)

nice article and very easy to follow

[Rocky Das](https://hashnode.com/@rockys4455)

[Sep 22, 2021](https://hashnode.com/posts/typescript-best-practices-2-use-more-precise-type-than-string-1/6149f3e920bcc6765ac0513c/comment/614afe26544e242e0c93cb16)

well explained. Pls share more articles with react and typescript

[Jide Abdul-Qudus](https://hashnode.com/@jideabdqudus)

[Sep 21, 2021](https://hashnode.com/posts/typescript-best-practices-2-use-more-precise-type-than-string-1/6149f3e920bcc6765ac0513c/comment/614a3e5d699fe76cd34873d5)

Lovely article, I started using typescript for my react projects last year and I had no idea about the Union Type or Enum.

[Vikrant Bhat](https://hashnode.com/@bhatvikrant)

[Sep 21, 2021](https://hashnode.com/posts/typescript-best-practices-2-use-more-precise-type-than-string-1/6149f3e920bcc6765ac0513c/comment/6149f7d6699fe76cd3486b41)

Great article [Harshit Jain](https://hashnode.com/@harshitjain), explained very well.

[Harshit Jain](https://hashnode.com/@harshitjain)

[Sep 21, 2021](https://hashnode.com/posts/typescript-best-practices-2-use-more-precise-type-than-string-1/6149f3e920bcc6765ac0513c/comment/6149f7d6699fe76cd3486b41#reply-614a14b6699fe76cd3486e46)

Thanks [Vikrant Bhat](https://hashnode.com/@bhatvikrant), I am glad you liked it.

You might also like part 1 of this series, here's the link to it (if you haven't read it already)

[blog.jainharshit.com/typescript-best-practices-1-…](https://blog.jainharshit.com/typescript-best-practices-1-always-prefer-type-declaration-over-type-assertion)
