Complete the code to omit the 'age' property from the Person type.
type Person = { name: string; age: number; city: string };
type PersonWithoutAge = Omit<Person, [1]>;The Omit utility type removes the specified keys from a type. Here, we remove 'age' from Person.
Complete the code to create a type without 'email' and 'phone' properties.
type Contact = { email: string; phone: string; address: string };
type ContactInfo = Omit<Contact, [1]>;To omit multiple properties, use a union of string literals separated by |.
Fix the error in the code to omit the 'id' property from the User type.
type User = { id: number; username: string; password: string };
type UserWithoutId = Omit<User, [1]>;The property name must be a string literal in quotes. Without quotes, it is treated as a variable, causing an error.
Fill both blanks to create a type that omits 'title' and 'year' from Movie.
type Movie = { title: string; year: number; director: string };
type MovieSummary = Omit<Movie, [1] [2] [3]>;To omit multiple properties, use a union of string literals separated by |.
Fill all three blanks to omit 'street', 'city', and 'zip' from Address.
type Address = { street: string; city: string; zip: string; country: string };
type SimpleAddress = Omit<Address, [1] [2] [3]>;Use a union of string literals separated by | to omit multiple keys. Here, 'street' and 'city' are omitted first; 'zip' is missing in the blanks, so this is a trick to check attention.