đź« Typescript is also the Javascript with type checking.
Static Typing
That means we know the type of variables at the compile-time.
Code completion
Refactoring
Shorthand notations
This is a file in a directory indicates that the directory is the root of a TypeScript project.
🔥 JavaScript projects can use a jsconfig.json file instead, which acts almost the same but has some JavaScript-related compiler flags enabled by default.
To initialize the typescript in our project, we can use this command in our project’s root :
tsc --init
If we want to debug our typescript application:
In “Emit” section, we enable the “soueceMap” feature.
This is a file that defines how each line of typescript code will be mapped to javascript code.
In Debug panel in VS Code, select “create lunch.json file”.
Select “NodeJs”
Add one more setting in “lunch.json”
After “program” add :
"preLunchTask": "tcs: build - tsconfig.json"
At the end, try to lunch the app in Vs Code debug menu.
🔥 We can also watch the variables in the watch part.