Easy
Given the following TypeScript code, what is the type of result?
type SomeType = { a: number; b: string; c: boolean };
type OtherType = Pick<SomeType, 'a' | 'b'>;
const result: OtherType = { a: 42, b: 'hello' };
Author: Vincent CotroStatus: PublishedQuestion passed 730 times
Edit
4
Community EvaluationsNo one has reviewed this question yet, be the first!
Similar QuestionsMore questions about Typescript
6
Create a generic reverseArray function to reverse the elements of an array while maintaining type safety.5
Define a custom type that represents a coordinate with an x and y property of type number in Typescript5
Import an add function from a TypeScript module math.ts4
Which of the following utility types makes all properties of a given type optional?3
Explain the difference between the `any` and `unknown` types in TypeScript.