Introduction to typescript

TypeScript is a programming language similar to JavaScript but with additional features like static type checking. So TypeScript is superset of JavaScript. Javascript syntax is valid in typescript but due to it’s additional rules on how different types can be used it throws error while writing the code itself where the type information is not provided or not matching. While working with typescript we should be very careful with data type. Follow the syntax and specify data type information while writing the code.

Browsers only understand Javascript – how typescript works?
Type checking happens at compiling time and once code is compiled, TypeScript compiler removes the type information and the final JavaScript code is ready to run in the browser or anywhere JS is supported. So both has same runtime.

TypeScript code compiles to JavaScript code
'typescript' == 'javascript'

Official Website:

Typescript version 4.7 announced on 24th May, 2022. See full list of new 4.7 features here.

Section Summary:
-TypeScript is strongly typed and superset of JavaSript
-TS shares syntax and runtime with JS
-TS throws errors at compiling time/while writing code

Useful Info:
Difference between static typing and dynamic typing?
Difference between strong typing and weak typing?