In TypeScript, when you declare a variable, you specify basic data types using : type.
- string: "Hello"
- number: 100, 3.14
- boolean:
trueorfalse - 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