Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR TYPESCRIPT

typescript pick type from interface

interface Todo {  title: string;  description: string;  completed: boolean;}
type TodoPreview = Pick<Todo, "title" | "completed">;
const todo: TodoPreview = {  title: "Clean room",  completed: false,};
todo; const todo: TodoPreviewTry
Source by www.typescriptlang.org #
 
PREVIOUS NEXT
Tagged: #typescript #pick #type #interface
ADD COMMENT
Topic
Name
3+7 =