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

Type Narrowing

Type Narrowing คือกระบวนการที่ TypeScript จำกัด type ให้แคบลงจาก union หรือ broad type เป็น specific type ผ่าน control flow analysis

ข้อดีคำอธิบาย
Type Safetyเข้าถึง properties ได้อย่างปลอดภัย
AutocompleteIDE รู้ว่ามี methods อะไรบ้าง
Error Preventionไม่เรียก method ที่ไม่มี
Diagram

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

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