Here's the repo for learning typescript from this Bilibili course: 尚硅谷TypeScript教程(李立超老师TS新课)
Course Link: P3 02_TS的类型声明
// declear with type
let a: number;
let b: string;
// declear with type and value
let c: boolean = true;
// ts can auto detect
let c = false; // here ts will know that c has to be boolean.
Compile typescript file:
tsc example.ts
notice that there are many ways to specify how we want to compile (to es3, es6, or others)
The types of typescript: