DEV Community

Mahadi Hasan
Mahadi Hasan

Posted on

Exploring TypeScript

According to the typescript website

"TypeScript is JavaScript with syntax for types.

TypeScript is a strongly typed programming language that builds on JavaScript, giving you better tooling at any scale."

That's all that does mean. In this case, no matter what you're working with, like javascript, react, angular or etc., that concerns javascript, you gotta go with typescript. It saves time and makes you more confident in finding bugs and errors.

It has some excellent capabilities, like a throwing compiling error. It continuously monitors your code, whether you edited it or not; if edited, what is the type issue and many more things.
Typescript is really easy to learn. It is a superset of javascript. That's all that it says, meaning it can hold all the javascript valid code along with its features.

In javascript, we define a variable like

const abc = "Hello world!"
Enter fullscreen mode Exit fullscreen mode

But in typescript, we have to define its type, whether it is a string, number, etc.

const abs:string = "Hello world!"
Enter fullscreen mode Exit fullscreen mode

Typescript itself has so may advantages like:

  • Support for modern JavaScript features
  • Advanced type system
  • Developer tooling support
  • Optionally static typing and type inference
  • Enhanced IDE support
  • Strict null checks
  • Compilation
  • JavaScript interoperability
  • Converting from JavaScript to TypeScript

To be continued.

Top comments (0)