Skip to content
Medium
Type guards

Narrow with in/typeof

Given a union of objects and primitives, write a describe() function that safely handles each variant using typeof and in guards.

Starter provided. Feel free to modify.

Solution

Loading...
Run your code to see output and diagnostics.

Built by Antigravity. The source code is available on GitHub.