Skip to content
เข้าสู่ระบบ

Type Erasure

TypeScript types จะถูก “erase” ตอน compile เป็น JavaScript ไม่มี types ที่ runtime นี่คือ design decision สำคัญที่ต้องเข้าใจ

Compile TimeRuntime (JavaScript)
Types checkedTypes removed
Generics resolvedGenerics gone
Interfaces existInterfaces removed
Errors caughtNo overhead

เข้าสู่ระบบเพื่อดูเนื้อหาเต็ม

ยืนยันตัวตนด้วยบัญชี Google เพื่อปลดล็อกบทความทั้งหมด