title: Typescript - Update object properties dynamically with Object.entries
body: <p>I want to implement a function that loops over the properties of an object and applies updates to another object of the same type.</p>
  <pre><code>interface Car {
    tires: number;
    name: string;
  }
  
  function updateCar(car: Car, updates: Partial&lt;Car&gt;) {
    Object.entries(updates).forEach(([key, value]) =&gt; {
      car[key] = value;
    })
  }
  </code></pre>
  <p>The issue here is that there is an error</p>
  <pre><code>No index signature with a parameter of type 'string' was found on type 'Car'
  </code></pre>
  <p>when casting the key to <code>keyof Car</code> it works, but as soon as using <code>&quot;noImplicitAny&quot;: true</code> there is again an error</p>
  <pre><code>Type 'string | number' is not assignable to type 'never'
  </code></pre>
  <p>Is there a way to solve this issue in a type-safe matter. Casting the car to any would work but I'd like to avoid it.</p>
  <p>Many thanks
  Bene</p>