-
Notifications
You must be signed in to change notification settings - Fork 0
Fundamental Types
Jorge Castro edited this page Nov 10, 2025
·
1 revision
- Refer to the Variables with Type Annotations example.
let data: any = { country: 0 };
data.process();
data();
data.name = 100;
data = "hello";
const age: number = data;function isPhraseExceedingLimit(phrase: string, limit: number): boolean {
return phrase.length > limit;
}Promise<T> is a built-in type.
async function getFavoriteNumber(): Promise<number> {
return 26;
}const names = ["Alice", "Bob", "Eve"];
names.forEach((name) => {
console.log(name.toUpperCase());
});- Sync-Obsidian-with-GitHub-on-iOS
- Obsidian-community-plugins
- Optimizing-Novel-Word-Count-Plugin-for-Git-Users
- What is TypeScript, and why you should use it
- Quick setup
- Inference and type annotations
- Fundamental Types
- Object Types
- Union Types
- Type Aliases and Interfaces
- Type Assertions
- Literal Types
- null and undefined
- Narrowing
- Creating Types from Types
- Common Built‐in and Utility Types
- tsc CLI ‐ (The Compiler)
- Avoid using Object or {}
- Ignoring TypeScript errors
- TypeScript resources