Beginner

Hello World

BEGINNER
20
93
@typehero
4 months ago

Hello, World!

In Type Challenges, we use the type system itself to do the assertion.

For this ch

Generic Function Arguments

BEGINNER
24
147
@dimitropoulos
1 year ago

Give generic function types to your functions

Generic Type Arguments

BEGINNER
10
70
@dimitropoulos
1 year ago

Generic types are like function arguments.

Generic Type Constraints

BEGINNER
4
59
@dimitropoulos
1 year ago

Generic type constraints allow us to restrict the possible types a generic type will accept.

Index Signatures

BEGINNER
8
62
@dimitropoulos
1 year ago

Index signatures allow us to handle types where the properties are a non-specific literal value.

Indexed Types

BEGINNER
12
44
@dimitropoulos
1 year ago

Some types can be indexed to lookup a particular value.

The `keyof` operator

BEGINNER
5
37
@dimitropoulos
1 year ago

keyof allows us to extract a union of another type's keys.

Literal Types

BEGINNER
23
47
@dimitropoulos
1 year ago

TypeScript can be more specific than string or number. It can remember literal values.

Mapped Object Types

BEGINNER
9
52
@dimitropoulos
1 year ago

Mapping objects is a foundational skill that allows you to write type translation logic.

Primitive Data Types

BEGINNER
18
86
@dimitropoulos
1 year ago

Your TypeScript journey starts with these building blocks.

Type Aliases

BEGINNER
6
60
@dimitropoulos
1 year ago

You can create multiple names for the same type.

The `typeof` Operator

BEGINNER
8
63
@dimitropoulos
1 year ago

When you need to create a type from existing JavaScript values, typeof is the tool for the job.

Default Generic Arguments

BEGINNER
6
109
@dimitropoulos
1 year ago

Default generic arguments allow you to optionally pass a generic argument.

Type Unions

BEGINNER
4
27
@dimitropoulos
1 year ago

Type unions are a powerful tool that allow you to create a type that's many values all at once.