This is the 23rd day of my participation in the August More Text Challenge
TypeScript is an open source superset of JavaScript developed by Microsoft for adding additional functionality without breaking existing programs. Because of its unique advantages, such as static typing and many shorthand notations, TypeScript is now widely used by front-end and full-stack developers on large projects.
Key features of TypeScript
- Cross-platform: the TypeScript compiler can be installed on any operating system, including Windows, macOS, and Linux.
- ES6 features: TypeScript includes most of the planned ECMAScript 2015 (ES6) features, such as arrow functions.
- Object-oriented language: TypeScript provides all standard OOP functionality, such as classes, interfaces, and modules.
- Static type checking: TypeScript uses static typing and helps with type checking at compile time. As a result, you can find compile-time errors while writing code without having to run scripts.
- Optional static typing: If you’re used to dynamic typing in JavaScript, TypeScript also allows optional static typing.
- DOM manipulation: You can manipulate the DOM using TypeScript to add or remove client-side web page elements.
The advantages of the TypeScript
- TypeScript is more expressive and has less cluttered syntax.
- Because advanced debuggers focus on catching logic errors before compile time, debugging is easy.
- Static typing makes TypeScript easier to read and more structured than JavaScript’s dynamic typing.
- Due to generic translation, it can be used cross-platform, both on client and server side projects
How TypeScript relates to JavaScript?
TypeScript is an open source syntactic superset of JavaScript that compiles to JavaScript. All of the original JavaScript libraries and syntax are still valid, but TypeScript adds additional syntax options and compiler capabilities not found in JavaScript.
TypeScript also works with most of the same technical interfaces as JavaScript, such as Angular and jQuery.
What are TypeScript’s built-in data types
-
Numeric type: A value used to represent a numeric type. All numbers in TypeScript are stored as floating point values.
-
Boolean type: A logical binary switch containing true or false
-
Null type: Null denotes a variable whose value is undefined.
-
Undefined type: An undefined literal that is the starting point for all variables.
-
Void type: Type assigned to a method that does not return a value.
What is JSX in TypeScript?
JSX is an embeddable XML-like syntax that allows you to create HTML. TypeScript supports embedding, type checking, and compiling JSX directly into JavaScript.
What JSX schemas does TypeScript support?
TypeScript has built-in support for Preserve, React, and React-Native.
-
Preserve keeps JSX intact for subsequent conversions.
-
React is not converted by JSX. Instead, react. CreateElement is emitted and output as a.js file extension
-
React native combines preserve, React because it maintains all JSX and output as.js extensions.