---
title: "Comment by Purvi Barot on \"What is Typescript?\" | Hashnode"
description: "TypeScript is a superset of JavaScript which primarily provides optional static typing, classes and interfaces. One of the big benefits is to enable IDEs to pro"
url: "https://hashnode.com/posts/what-is-typescript/5ed3e72d123fdcb70b936548/comment/5f226f98ef20f63bcf9827d2"
---

[Discussion](https://hashnode.com/posts/what-is-typescript/5ed3e72d123fdcb70b936548)

Comment [What is Typescript?](https://hashnode.com/posts/what-is-typescript/5ed3e72d123fdcb70b936548)

[Purvi Barot](https://hashnode.com/@purvi)

[Jul 30, 2020](https://hashnode.com/posts/what-is-typescript/5ed3e72d123fdcb70b936548/comment/5f226f98ef20f63bcf9827d2)

-   TypeScript is a superset of JavaScript which primarily provides optional static typing, classes and interfaces. One of the big benefits is to enable IDEs to provide a richer environment for spotting common errors as you type the code.

**Why Typescript?**

-   TypeScript supports JS libraries & API Documentation
-   It is a superset of Javascript
-   It is optionally typed scripting language
-   TypeScript Code can be converted into plain JavaScript Code
-   Better code structuring and object-oriented programming techniques
-   Allows better development time tool support
-   It can extend the language beyond the standard decorators, async/await

As an example:

```
class Greeter {
    greeting: string;
    constructor (message: string) {
        this.greeting = message;
    }
    greet() {
        return "Hello, " + this.greeting;
    }
}
```
