Easy

Readonly

EASY
2
41
@typehero
4 months ago

Implement the built-in Readonly<T> generic without using it.

Constructs a type with all proper

Tuple to Object

EASY
4
39
@typehero
4 months ago

Given an array, transform it into an object type and the key/value must be in the provided array.

First of Array

EASY
4
35
@typehero
4 months ago

Implement a generic First<T> that takes an Array T and returns its first element's type.

For

Length of Tuple

EASY
0
28
@typehero
4 months ago

For given a tuple, you need create a generic Length, pick the length of the tuple

For example:

Exclude

EASY
4
34
@typehero
4 months ago

Implement the built-in Exclude<T, U>

Exclude from T those types that are assignable to U

Awaited

EASY
16
54
@typehero
4 months ago

If we have a type which is a wrapped type like Promise, how can we get the type which is inside th

If

EASY
0
12
@typehero
4 months ago

Implement the util type If<C, T, F> which accepts condition C, a truthy value T, and a falsy

Concat

EASY
0
17
@typehero
4 months ago

Implement the JavaScript Array.concat function in the type system. A type takes the two argument

Includes

EASY
12
30
@typehero
4 months ago

Implement the JavaScript Array.includes function in the type system. A type takes the two argume

Push

EASY
1
16
@typehero
4 months ago

Implement the generic version of Array.push

For example:

type Result = Push<

Unshift

EASY
0
7
@typehero
4 months ago

Implement the type version of Array.unshift

For example:

type Result = Unshi

Parameters

EASY
0
14
@typehero
4 months ago

Implement the built-in Parameters generic without using it.

For example:

const foo = (a

The `Pick` builtin

EASY
1
14
@dimitropoulos
1 year ago

TypeScript ships with a Pick type. Learn how to make it yourself!