type MyUser = {
name: string;
age: string
id: string;
}
//omit multiple propertiestype NewUser1 = Omit<MyUser, "id" | "age">
const newUser: NewUser1 = {
name: "sangram"
}
//pick multiple properties
type NewUser2 = Pick<MyUser, "id" | "age">
const newUser2: NewUser2 = {
id: "sangram",
age: "45"
}
No comments:
Post a Comment