Skip to content
</>
code
vault
Learn
Leaderboard
Certificates
Shop
Sign in
☰
Learn
Leaderboard
Certificates
Shop
Sign in
Lesson 15 of 24 · +120 xp
Type Guard
Narrow with typeof.
Explained simply
Your task
Write: if (typeof x === 'string') { x.toUpperCase(); }
Show a hint
narrow.ts
Reset
1
2
3
4
5
6
7
8
9
10
11
12
← Back
Check my code
Ask AI tutor
⌕
Quick jump
⌘K