Skip to main content
Journey Uncommon Logo
JourneyUncommon
mediumTypeScriptbranded nominal typingSingle-choice MCQ

Both brands wrap `number`. Which assignment is rejected?

type Brand<T, B extends string> = T & { readonly __brand: B }; type Km = Brand<number, "Km">; type Mile = Brand<number, "Mile">; declare const k: Km; declare const n: number; const a: Mile = k; // line A const b: Km = 5 as Km; // line B