Advanced Typescript. Type Guards and Differentiating Types

Prerequisites

Type Guards and Differentiating Types

1.1 Using “typeof” keyword

1.2 Using "instanceof" keyword

1.3 Using user-defined Type Guards

function isSomeType(var): var is SomeType {...}

Java, Spring, Node.js, AdonisJs, React.js and Flutter developer

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store