-2

Is it useful? Why did Microsoft create it?

I don't understand what problem it solves.

What is the difference between TypeScript and Babel?

I tried JavaScript and TypeScript, but I can't find out why TypeScript should be used.

jonrsharpe
  • 115,751
  • 26
  • 228
  • 437

1 Answers1

1

According to https://dzone.com/articles/what-is-typescript-and-why-use-it:


Why Should We Use TypeScript?

  • TypeScript simplifies JavaScript code, making it easier to read and debug.
  • TypeScript is open source.
  • TypeScript provides highly productive development tools for JavaScript IDEs and practices, like static checking.
  • TypeScript makes code easier to read and understand.
  • With TypeScript, we can make a huge improvement over plain JavaScript.
  • TypeScript gives us all the benefits of ES6 (ECMAScript 6), plus more productivity.
  • TypeScript can help us to avoid painful bugs that developers commonly run into when writing JavaScript by type checking the code.
  • Powerful type system, including generics.
  • TypeScript is nothing but JavaScript with some additional features.
  • Structural, rather than nominal.
  • TypeScript code can be compiled as per ES5 and ES6 standards to support the latest browser.
  • Aligned with ECMAScript for compatibility.
  • Starts and ends with JavaScript.
  • Supports static typing.
  • TypeScript will save developers time.
  • TypeScript is a superset of ES3, ES5, and ES6.

Additional Features of TypeScript

  • Functions with optional parameters.
  • Functions with REST parameters.
  • Generics support.
  • Modules support.

TypeScript is a fantastic tool for JavaScript developers. It makes working on larger projects easier and provides a better code-writing toolkit that can greatly improve your software development process.

informatik01
  • 16,038
  • 10
  • 74
  • 104
Paul Cbt
  • 125
  • 8
  • 1
    TypeScript does not make code easier to read. How would it? - The only thing you are doing is adding even more words, it doesn't shorten or simplify anything. Most of the times it makes stuff harder to read, because you have to mention the class in the middle of the statement. Vanilla JavaScript also has optional parameters (all parameters are optional), REST parameters and Modules support. So the only additional feature is generics support / types.. – FireFuro99 Aug 15 '22 at 15:39