Lesson 15 of 24 · +120 xp

Type Guard

Narrow with typeof.

Explained simply

Your task

Write: if (typeof x === 'string') { x.toUpperCase(); }

narrow.ts
← Back