Learning more of typescript with type level typescript lessons.
Use case: when I don't know the type in advance.
namespace challenge {
type GetAllKeys<obj> = keyof obj;
GetAllKeys<{ name: string; age: number }>; // "name" | "age"
}
Learning more of Typescript with: https://type-level-typescript.com lessons.
TypeScript
Learning more of typescript with type level typescript lessons.
Use case: when I don't know the type in advance.
namespace challenge {
type GetAllKeys<obj> = keyof obj;
GetAllKeys<{ name: string; age: number }>; // "name" | "age"
}