Answers for "typescript keyof"

11

typescript keyof

interface Person {
  name: string;
  age: number;
  location: string;
}

type K1 = keyof Person; // "name" | "age" | "location"
type K2 = keyof Person[]; // "length" | "push" | "pop" | "concat" | ...
type K3 = keyof { [x: string]: Person }; // string
Posted by: Guest on September-20-2020

Code answers related to "TypeScript"

Browse Popular Code Answers by Language