Beginner
Hello World
Hello, World!
In Type Challenges, we use the type system itself to do the assertion.
For this ch
Generic Function Arguments
Give generic function types to your functions
Generic Type Arguments
Generic types are like function arguments.
Generic Type Constraints
Generic type constraints allow us to restrict the possible types a generic type will accept.
Index Signatures
Index signatures allow us to handle types where the properties are a non-specific literal value.
Indexed Types
Some types can be indexed to lookup a particular value.
The `keyof` operator
keyof
allows us to extract a union of another type's keys.
Literal Types
TypeScript can be more specific than string
or number
. It can remember literal values.
Mapped Object Types
Mapping objects is a foundational skill that allows you to write type translation logic.
Primitive Data Types
Your TypeScript journey starts with these building blocks.
Type Aliases
You can create multiple names for the same type.
The `typeof` Operator
When you need to create a type from existing JavaScript values, typeof
is the tool for the job.
Default Generic Arguments
Default generic arguments allow you to optionally pass a generic argument.
Type Unions
Type unions are a powerful tool that allow you to create a type that's many values all at once.