Skip to main content
Journey Uncommon Logo
JourneyUncommon
mediumTypeScriptfunction overloadsSingle-choice MCQ

Given these overloads on `format`, what happens when this function is called from outside via the value `fmt`?

function format(x: number): string; function format(x: boolean): string; function format(x: number | boolean): string { return String(x); } const fmt: (x: number | boolean) => string = format; fmt(42);