-
Notifications
You must be signed in to change notification settings - Fork 0
What is TypeScript, and why you should use it
Jorge Castro edited this page Nov 10, 2025
·
1 revision
Both the TypeScript home page and Nimesh Sakhiya's LinkedIn article offer insights into what TypeScript is and highlight its advantages.
const blueTriangle = { base: 10, height: 5 };
function calculateTriangleArea(triangle) {
return (triangle.base * triangle.heigth) / 2;
}
console.log(calculateTriangleArea(blueTriangle));This will log 'NaN' instead of the expected area.
function sumNumbers(a, b) {
return a + b;
}
const r1 = sumNumbers(17, 6);
const r2 = sumNumbers("17", "6");
const r3 = sumNumbers(17, "6");
const r4 = sumNumbers(17, "");
const r5 = sumNumbers(17, []);The results will be: r1 = 23, r2 = "176", r3 = "176", r4 = "17", r5 = "17"
const message = "Hello World!";
console.log(message.toUpperCase());
message();- 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