What the heck is typescript?

Yashraj basan
3 min readMay 1, 2020

Every other developer, the project manager is talking about using typescript for their projects. but what is heck it is? why do we need typescript?
can typescript replace the javascript? in this article, I will try to cover all these questions about typescript.

What is typescript?

Typescript is nothing but object-oriented programming language which transpile modern javascript to old javascript so, the old engines can execute it. syntax of typescript is similar to javascript but typescript is object-oriented and js is prototypal language. modern javascript doesn’t support static type checking.typescript is created to make javascript development efficient. because static type checking is not supported in modern javascript it leads to type conversions and it further leads to unexpected output. typescript makes code more scalable and readable then javascript.syntax of typescript is similar to javascript it means you can use typescript with existing javascript code. typescript also gives development tools so you can integrate with your IDE for rapid javascript development. typescript support all existing js features and future proposals even you can use async and await. extension of typescript is “.ts”. so, you can change the extension and started development

What is the need of typescript?

Typescript adds a security layer in your codebase. let’s understand by example.let say there is a function which adds 1 and return the result and it returns the result in the form of a number.

for example

as you see from the above example that when I passed the argument as string and array. type-conversion happened in js and it returned result in the form of string. to avoid this kind of problem typescript is needed.

developers wanted to use modern javascript syntax and features because it is easy to write but javascript engines don’t support modern javascript syntax to overcome this problem we also need typescript

as web app started becoming complex it is good practice to make code scalable, maintainable, readable, and using typescript we can achieve it.

Can typescript replace the javascript?

NO, typescript is not an alternative of javascript.it is nothing but transpiler is which converts modern js syntax to old js syntax. so, engines can execute it.
the core of the typescript is javascript and all existing features and future proposals you can use it. but I think that it will influence in javascript web applications because of its standards and features. javascript by default language of every browser.

Conclusion

Typescript is a transpiler that converts modern javascript syntax to old javascript syntax. it supports all kinds of existing javascript features and future proposals. due to static type checking and its features, we can write code more scalable, readable, maintainable. typescript will not replace the javascript but it will influence in javascript libraries, web apps because of its features

--

--