← Code LabTypeScript0/50 solved · 0%
Control Flow · easy

11. Narrowing: typeof

Using typeof for basic narrowing.

Write `formatPrice(price)`: if price is number, return `$N.00`, if string, return it as is.
Required in your answer: typeof price === 'number'