Code QuizAdvanced

Conditional Type Syntax

Conditional types decide between two types based on assignability, not JavaScript equality.

Codetypescript
type IsString<T> = T === string ? true : false;

type A = IsString<"hi">; // want true
type B = IsString<number>; // want false

What is the bug in this conditional type?