Object Types Comparison
มีหลายวิธีกำหนด object types แต่ละวิธีมีข้อดีข้อเสียต่างกัน เลือกใช้ให้เหมาะสมกับ use case
เปรียบเทียบหลัก
Section titled “เปรียบเทียบหลัก”| Feature | Interface | Type Alias | Class |
|---|---|---|---|
| Object shapes | Yes | Yes | Yes |
| Extends/Implements | extends | & intersection | extends/implements |
| Declaration merging | Yes | No | No |
| Unions | No | Yes | No |
| Runtime value | No | No | Yes |
เข้าสู่ระบบเพื่อดูเนื้อหาเต็ม
ยืนยันตัวตนด้วยบัญชี Google เพื่อปลดล็อกบทความทั้งหมด
Login with Google