Implement the built-in Readonly<T> generic without using it.
Readonly<T>
Constructs a type with all proper
Given an array, transform it into an object type and the key/value must be in the provided array.
Implement a generic First<T> that takes an Array T and returns its first element's type.
First<T>
T
For
For given a tuple, you need create a generic Length, pick the length of the tuple
Length
For example:
Implement the built-in Exclude<T, U>
Exclude<T, U>
Exclude from T those types that are assignable to U
U
If we have a type which is a wrapped type like Promise, how can we get the type which is inside th
Implement the util type If<C, T, F> which accepts condition C, a truthy value T, and a falsy
If<C, T, F>
C
Implement the JavaScript Array.concat function in the type system. A type takes the two argument
Array.concat
Implement the JavaScript Array.includes function in the type system. A type takes the two argume
Array.includes
Implement the generic version of Array.push
Array.push
type Result = Push<
Implement the type version of Array.unshift
Array.unshift
type Result = Unshi
Implement the built-in Parameters generic without using it.
const foo = (a
TypeScript ships with a Pick type. Learn how to make it yourself!
Pick