What is TypeScript?
TypeScript is a typed superset of JavaScript that compiles to plain JavaScript. It adds optional static typing and class-based object-oriented programming.
Why TypeScript?
- Catch errors early: Find bugs at compile time, not runtime
- Better tooling: Improved autocomplete, refactoring, and navigation
- Self-documenting: Types serve as documentation
- Scalable: Easier to maintain large codebases
Your First TypeScript Program
Type Annotations
In TypeScript, you can add type annotations to variables:
Compilation
TypeScript compiles to JavaScript. Click "Show JS" to see the output:
The types are removed during compilation - they're only for development!
Exercise: Add Types
Add type annotations to the variables:
التالي · الدرس 2 من 34
Your First Types
قراءة 1 دقيقة
أنهيت 1 من 34 درسًا

اسأل Byte عن هذا الدرس
محادثة خاصة حول هذا الدرس. قرأ Byte الدرس كاملًا، ويجيب خلال ثوانٍ، ويُظهر القسم الذي تأتي منه كل إجابة. يمكنك السؤال بأي لغة.
الأسئلة والأجوبة
أسئلة عامة حول هذا الدرس. يجيب AI Tutor فورًا بلغتك، ويراجع فريق FreeAcademy الإجابات، ويمكن لكل المتعلمين قراءتها.

