Thuta Learning
BasicProgrammingintermediate

Basic Types

Relax. We'll talk through this in plain words — no textbook voice.

In TypeScript, when you declare a variable, you specify basic data types using : type.

  • string: "Hello"
  • number: 100, 3.14
  • boolean: true or false
  • any: can be any type at all (disables type checking)
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
Basic Types | Thuta Learning