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

After the `if (y !== null)` guard, does `y.toUpperCase()` compile, and why?

let y: string | null = "a"; function g() { y = null; } if (y !== null) { g(); y.toUpperCase(); }