title: how to define a type under forEach in typescript?
body: <p>I have an array of <code>PersonTypes</code> objects and would like to only use partial of key inside a forEach loop. what is more 
  precise, correct coding in typescript to provide a type? I can do something like
  <code>people.forEach((person: Pick&lt;PersonTypes, 'name' | 'gender'&gt;</code>
  or
  <code>people.forEach((person: PersonTypes) =&gt;{</code>
  or 
  <code>people.forEach((person: any) =&gt;{</code>
  what is right way to code in typescript</p>
  
  <pre><code>export type PersonTypes = {
    name: string;
    value: string;
    gender: boolean;
  };
  const people: PersonTypes[] = [
    {name: 'apl', value: 'apple', gender: true},
    {name: 'gal', value: 'google', gender: false},
  ]
  people.forEach((person: Pick&lt;PersonTypes, 'name' | 'gender'&gt;) =&gt;{
  //people.forEach((person: PersonTypes) =&gt;{
  //people.forEach((person: any) =&gt;{
    console.log(person.name);
    console.log(person.gender);
  } )
  </code></pre>