ENع
الدرس 16 · Advanced and in practice

TypeScript in real projects

لم يُترجم بعد؛ يُعرض باللغة الإنجليزية

Types are checked before a program runs and then erased, so they cannot see data that arrives while it runs: a server reply, a file, a form. Follow a small program that reads {"name":"Ada","age":"36"}. Cast with as User, tsc finds nothing and it prints 361. Typed unknown and checked by a type guard, the bad reply is stopped ("bad data") and the good one prints 37.

12 دقيقة9 خطوات5 أسئلةBeginner
شكل 16 · تفاعلي
جارٍ تحميل الرسم…
أو ← →

اختبار يتاح بعد الخطوة الأخيرة.