Introducing TypeScript

TypeScript is a superset of the JavaScript language that was built by Microsoft. It adds the functionality of being able to add types to JavaScript code and transpiles the TypeScript code into JavaScript. The advantage that we get by using TypeScript is that since it's a compiled language that compiles to JavaScript, we get failure information (if there is any) at compile time. This means that we don't find errors after the JavaScript code gets to run on the browser.

TypeScript adoption has been increasing since 2016. One of the reasons for its adoption in the JavaScript ecosystem has been Angular. Angular is built entirely using TypeScript, and so is almost all of the community's Angular modules and the applications using it.

TypeScript not only supports most of the features from ECMAScript, such as classes, arrow functions, template literals, import/export, and so on, but also transpiles them to equivalent ES5 JavaScript code so that you don't have to worry about supporting browsers that don't support specific ECMAScript features.

Let's cover a few of the important concepts of TypeScript, interfaces, decorators, and access modifiers.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.138.122.4