title: Type 'string[]' cannot be used as an index type.ts(2538)
body: <p>TS Error:</p>
  
  <blockquote>
    <p>Type '(string | undefined)[]' cannot be used as an index type.ts(2538)</p>
  </blockquote>
  
  <p>Code:</p>
  
  <pre><code>Object.values(payload.reduce((acc, obj) =&gt; {
    let key = obj.values.map(i =&gt; i.object_id);
    if (!acc[key]) {
      acc[key] = []
    }  
    acc[key].push(obj)
    return acc
  }, {}))
  </code></pre>
  
  <p>Works fine in the javascript code. Why?</p>