Thuta Learning
ရှာဖွေရန်
BasicProgrammingintermediate

Basic Types

စိတ်လျှော့ပါ။ ဒီခန်းကို စာအုပ်လိုမဟုတ်ဘဲ စကားပြောသလိုပဲ၊ နားလည်လွယ်အောင် ရှင်းပါမယ်။

TypeScript တွင် အခြေခံ data types များကို variable ကြေညာသည့်အခါ : type ဖြင့် သတ်မှတ်ပေးရသည်။

  • string: "Hello"
  • number: 100, 3.14
  • boolean: true or false
  • 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