Typescript: using the "unknown" type

Example:

let notSure: unknown = 4;
notSure = "maybe a string now";
notSure = true;
The "unknown" type is a safe counterpart to the "any" type.

Solution:

// Use "unknown" when the type could be anything but you want type-checking.

Beginner's Guide to TypeScript