Utility Types
TypeScript มี Utility Types ในตัวที่ช่วยแปลง Types ได้หลากหลายรูปแบบ ทำให้ไม่ต้องเขียน Types ซ้ำๆ และโค้ดอ่านง่ายขึ้น
หมวดหมู่ Utility Types
Section titled “หมวดหมู่ Utility Types”| หมวด | Types | ใช้สำหรับ |
|---|---|---|
| Property | Partial, Required, Readonly | จัดการ property modifiers |
| Pick/Omit | Pick, Omit | เลือก/ตัด properties |
| Record | Record | สร้าง object types |
| Exclude | Exclude, Extract | จัดการ union types |
| Return | ReturnType, Parameters | ดึง types จาก functions |
Utility Types Overview
Section titled “Utility Types Overview”เข้าสู่ระบบเพื่อดูเนื้อหาเต็ม
ยืนยันตัวตนด้วยบัญชี Google เพื่อปลดล็อกบทความทั้งหมด
Login with Google