Special Types
TypeScript มี special types ที่ใช้สำหรับกรณีพิเศษ เข้าใจความแตกต่างช่วยให้ใช้งานได้ถูกต้อง
เปรียบเทียบ Special Types
Section titled “เปรียบเทียบ Special Types”| Type | คำอธิบาย | Use Case |
|---|---|---|
any | ปิด type checking | Legacy code |
unknown | ต้อง check ก่อนใช้ | API responses |
void | ไม่มี return | Side effects |
never | ไม่มีวันเกิดขึ้น | Error throwing |
เข้าสู่ระบบเพื่อดูเนื้อหาเต็ม
ยืนยันตัวตนด้วยบัญชี Google เพื่อปลดล็อกบทความทั้งหมด
Login with Google