Loading topic
string | number, and JavaScript control flow with if, switch, and ternary expressions.1 min readif and switch statements. Type narrowing is TypeScript’s control flow analysis: it uses checks in your code to replace a broad type with a more specific type inside a branch.1 min readif statements. A type guard is a function that checks a value at runtime and tells TypeScript its type.1 min read