Skip to main content
Journey Uncommon Logo
JourneyUncommon
hardTypeScriptcontrol-flow analysis pitfallsSingle-choice MCQ

Given a `let` with an explicit union annotation, which sequence of narrowings is correct?

declare function getValue(): string | number; function test() { let x: string | number = "hello"; x.toUpperCase(); // line A x = getValue(); x.toUpperCase(); // line B }