DeepFrontend
Learning Paths
Practice
System Design & DS
Design Studio
Data Structures Curriculum
Real-World Case Studies
Careers
Job Board
Resume Builder
Blog
Sign in
Search
⌘K
Go Pro
Loading compiler resources...
TypeScript Quiz Practice
Active Recall Drill Session
← Exit Session
Question 1 of 1
hard
TypeScript
A narrowed variable x (typeof x !== "string" check passed, so x: string) is captured by a setTimeout callback. Later in the SAME function, x is reassigned to a number. What happens inside the callback?
A
x remains typed as string inside the callback, unaffected by the later reassignment
B
TypeScript widens x's type back to the full original union INSIDE the callback specifically, since it can't prove the callback runs before the reassignment
C
This causes a syntax error
D
The reassignment is simply ignored by the type checker
Check Answer