Avatar ·

How to exclude a property from a type in TypeScript?

Hello everyone! I started learning TypeScript and encountered a problem that I can't solve on my own. I have an interface for a user: ```typescript interface User { id: number; name: string; email: string; password: string; createdAt: Date; } ``` I need to create a new type that represents a user without the `password` field, for example, for displaying in the UI or passing to the client. I don't want to duplicate the entire interface by manually removing one field, as this violates the DRY principle and complicates maintenance. I've heard about built-in TypeScript utilities like `Pick`, `Partial`, `Omit`, but I'm not sure which one is suitable for my task. I tried using `Pick`: ```typescript type UserWithoutPassword = Pick; ```