Typescript Basics
Prequisites
- Vs Code
- npm
- node
- tsc
- npm install -g typescript
TS Datatypes
- boolean
- number
- string
- any
Define Variables in TS
Avoid to use type any: you lose type safety and a lot of the features of TypeScript.
Corrospoinding Js file will be created
- Using TSC, type the name of the typescript file. this makes a corrspnding JS file on running.
- to generated my command
- tsc src/components/product.ts
- run js file directly
- node src/components/product.js
Rendering string on screen