Add simple_types.ts

This commit is contained in:
2025-11-07 23:00:00 +01:00
parent 5fb118dd23
commit 80aa0421f8

14
src/simple_types.ts Normal file
View File

@@ -0,0 +1,14 @@
// You technically don't need to declare the variable type
let isBoolean: boolean = true;
let isBooleanInferred = true;
// TypeScript uses 'number' for all numeric values
let decimal: number = 6;
let hex: number = 0xf00d;
let binary: number = 0b1010;
let octal: number = 0o744;
let float: number = 3.14;
// String works with single, double, or backticks
let color: string = "purple";
let favorite_color = "blue";