Types
This lesson covers the key features of TypeScript's type system.
- Generics - https://www.typescriptlang.org/docs/handbook/2/generics.html
keyof
operator - https://www.typescriptlang.org/docs/handbook/2/keyof-types.htmltypeof
operator - https://www.typescriptlang.org/docs/handbook/2/typeof-types.html
Type predicate
Any function can be defined as a "type guard", which performs some validation and returns
a type predicate. For example, we can implement a function which checks for NaN
values during
runtime, and allows you to safely assume in your TypeScript program that the number
type does
not apply to invalid numbers.
Loading TypeScript...
Enums
An enum
is a collection of named constants.
Loading TypeScript...