- 📺 TypeScript UNKNOWN and ANY types • 5 minute video by Basarat Ali clearly explaining the difference between
any
andunknown
. - 📺 unknown, never, and void in TypeScript • 15 minute video by William Candillon showing a colleague practical use cases for
unknown
andnever
andvoid
. - 📺 null vs. undefined in JavaScript and TypeScript • 6 minute video by Basarat Ali showing examples of
null
andundefined
values and how to check for them. - 📺 TypeScript NEVER type - YouTube • 3 minute video by Basarat Ali showing how to use the
never
type to ensure all possible input types to a function have been handled. - 📺 TypeScript TYPES vs INTERFACES • 7 minute video by Basarat Ali explaining the overlapping and unique features of types and interfaces and recommending to pick one as your default (he defaults to types) based on which one's unique features are more likely to be useful to you.
- 📖 The Omit Helper Type in TypeScript • Article by Marius Schulz.
Compiler options
- 📺 TypeScript alwaysStrict: Do you need it? • 3 minute video by Basarat Ali explaining the benefits of setting
alwaysStrict
totrue
. - 📺 Why you should use allowUnreachableCode in TypeScript • 3 minute video by Basarat Ali explaining the benefits of setting
allowUnreachableCode
tofalse
.
Conditional types
- 📺 Conditional Types, TypeScript's most POWERFUL feature • 4 minute video by Basarat Ali using the example of a
typeName
helper to demonstrate how conditional types work and why you can think of them as functions that compute an output (a specific type) based on an input (a generic type). - 📺 TypeScripts amazing INFER Keyword • 3 minute video by Basarat Ali showing how to use the
infer
keyword inside a conditional type to get the type name of the generic argument that was passed in.
Generic types
- 📺 Why Generics? • 3 minute video by Basarat Ali showing how generics help in cases where a structure accepts alternating types of inputs and outputs.
Literal types
- 📺 Most common TypeScript literal types error • 4 minute video by Basarat Ali explaining how to reassure TS that a string or number is a valid member of a literal type.
Special types
- 📺 Lookup Types - one of the first super powers of TypeScript • 3 minute video by Basarat Ali showing how lookup types can clean up your code and prevent typos by using a larger root type as the source of truth for smaller types.
- 📺 What are TypeScript MAPPED Types and how to use them Effectively • 4 minute video by Basarat Ali using the example of creating a readonly version of an existing type to demonstrate how a mapped type is created by mapping over the properties of an existing type and modifying their definitions (similar to creating a new JS array by mapping over an existing array and returning a copy that transforms each item in some way).
- 📺 Mapped type MODIFIERS in TypeScript • 4 minute video by Basarat Ali showing how to use
+
,-
andPartial
to modify properties in a mapped type.
Operators
- 📺 NULLISH operators ?. and ?? for JavaScript and TypeScript • 5 minute video by Basarat Ali showing how to use
?.
and??
. - 📖 Nullish Coalescing: The ?? Operator in TypeScript • Article by Marius Schulz.
Type guards
- 📺 TypeScript 2.7:
in
-based type guards • 2 minute video by Basarat Ali showing how to use the JSin
operator as a type guard that both TS and JS will understand.