Skip to main content

10 docs tagged with "easy"

View all tags

Awaited

If we have a type which is wrapped type like Promise. How we can get a type which is inside the wrapped type?

Concat

Implement the JavaScript Array.concat function in the type system. A type takes the two arguments. The output should be a new array that includes inputs in ltr order

First of Array

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

If

Implement the util type If which accepts condition C, a truthy value T, and a falsy value F. C is expected to be either true or false while T and F can be any type.

Length of Tuple

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

Pick

Implement the built-in Pick generic without using it.

Push

Implement the generic version of Array.push

Readonly

Implement the built-in Readonly generic without using it.

Tuple to Object

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

Unshift

Implement the generic version of Array.unshift