Conditional type that checks if two types X and Y are exactly equal. If X is equal to Y, the type resolves to true; otherwise false.
X
Y
true
false
type Result1 = Equals<string, string>; // is true type Result2 = Equals<number, string>; // is false type Result3 = Equals<boolean | string, string | boolean>; // is true Copy
type Result1 = Equals<string, string>; // is true type Result2 = Equals<number, string>; // is false type Result3 = Equals<boolean | string, string | boolean>; // is true
Conditional type that checks if two types
X
andY
are exactly equal. IfX
is equal toY
, the type resolves totrue
; otherwisefalse
.