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

Type Predicates

Type Predicates ช่วยสร้าง custom type guards ที่ TypeScript เข้าใจ ทำให้ narrow types ได้ในจุดที่ built-in guards ทำไม่ได้

function isType(value: unknown): value is Type {
// return boolean
}

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

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