Tag: typescript
All the articles with the tag "typescript".
Implement Exclude
Implement the built-in Exclude<T, U>
Length of Tuple
Given a tuple, return the length of the tuple.
First of Array
Implement a generic First<T> that takes an Array T and returns its first element's type
Tuple to Object
Given an array, transform it into an object type and the key/value must be in the provided array.
Mapped Types
A mapped type is a type that transforms one type into another type by iterating over its properties.
Implement a Custom Utility Type: Readonly
Readonly is a utility type in TypeScript that allows you to create a new type by making all properties of an existing type readonly.
Implement a Custom Utility Type: Pick
Pick is a utility type in TypeScript that allows you to create a new type by picking a set of properties from an existing type.
Enums in Typescript
Enums in TypeScript are a way to define a set of named constants.
Typescript Utility Types: Partial<Type>
The Partial utility type in TypeScript is used to make all properties of a type optional.
Typescript Utility Types: Record<Keys, Type>
The Record utility type in TypeScript is used to create an object type whose keys are of a specified type and whose values are of another specified type. This utility type is useful for creating objects with specific key-value pairs, such as dictionaries or maps.