title: How to Omit a property from a type?
body: <p>I have a question about the Omit type in Typescript, so I know the Omit type is the opposite of <code>Pick</code> and is build like this: </p>
  
  <p><code>type Omit&lt;T, K extends keyof T&gt; = Pick&lt;T, Exclude&lt;keyof T, K&gt;&gt;</code></p>
  
  <p>But I don't know how to construct a Omit type. I have an interface of <code>Student</code> that looks like this: </p>
  
  <pre><code>interface Student { 
  name: string, 
  surname: string, 
  age: number, 
  email: string 
  }
  </code></pre>
  
  <p>I need a function that takes a Student as input with some given properties and outputs the Omited Student. The function should look like this: </p>
  
  <p><code>let omit_student = &lt;K extends keyof Student&gt;(student: Student, ...props: K[] ): Omit&lt;Student, K&gt; =&gt; null!</code></p>
  
  <p>But I don't know how I can dynamicaly omit the given properties from Student and what should happen in the body of the funtion. </p>
  
  <p>Calling the function like this: <code>omit_student(student1, "name", "age")</code>
  should output the following type: </p>
  
  <pre><code>{ 
  surname: string, 
  email: string 
  }
  </code></pre>