TypeScript တွင် အခြေခံ data types များကို variable ကြေညာသည့်အခါ : type ဖြင့် သတ်မှတ်ပေးရသည်။
- string: "Hello"
- number: 100, 3.14
- boolean:
trueorfalse - any: မည်သည့် type မဆိုဖြစ်နိုင်သည် (type checking ကို disable လုပ်သည်)
typescript
let framework: string = "TypeScript";
let version: number = 5.0;
let isAwesome: boolean = true;
// The 'any' type allows any kind of value
let anything: any = 4;
anything = "Now I'm a string";
console.log(`Learning ${framework} v${version}`);You should see
Learning TypeScript v5.0