title: Update an typescript object
body: <p>When things come to Javascript updating an object is something is like following.</p>
  
  <pre><code>const data = {
      a: 1,
      b: 3,
      c: 4
  }
  
  
  const update = (summary) =&gt; {
    data[summary] += 1;
    console.log(data);
  
  }
  
  update('a');
  </code></pre>
  
  <p>I tried the same thing with Typescript but it doesn't work as such
  I know I'm doing something wrong can someone point out the faults and how to work things out.</p>
  
  <pre><code>interface Summary { 
      a: number,
      b: number,
      c: number
  }
  
  const data: Summary = {
      a: 1,
      b: 3,
      c: 4
  }
  
  
  const updateData = (summaryType: string) =&gt; { 
      data[summaryType] += 1 // Error
  }
  </code></pre>
  
  <p>The Error is -> Element implicitly has an 'any' type because expression of type 'string' can't be used to index type 'Summary'. No index signature with a parameter of type 'string' was found on type 'Summary'.(7053)</p>