Skip to main content
Journey Uncommon Logo
JourneyUncommon
mediumTypeScriptassertion functionsSingle-choice MCQ

Given this assertion function, what is the type of `x` on the last line?

function assert(cond: unknown): asserts cond {} function f(x: string | null) { assert(x !== null); // x here }