title: Modify object property with a variable in typescript
body: <p>In js I have a function which modify properties of an object contained in a list of object according to parameters:</p>
  <pre><code>function edit(object, key, property, value){
    object[key][property] = value;
  }
  </code></pre>
  <p>How would I manage to do the same function in TypeScript ?</p>
  <p>From now I've made this:</p>
  <pre><code>function edit(object: ObjectList, key: string, property: string, value: number){
    object[key][property] = value;
  }
  </code></pre>
  <p>But that doesn't work and gives me a <code>Element implicitly has an 'any' type because expression of type 'string' can't be used to index type '{ name: string; mastery: number; parent_skill: number; access_level: number; cost: string; cost_value: number; background_color: number[]; font_color: number[]; description: string; required_skills: number[]; }'. No index signature with a parameter of type 'string' was found on type '{ name: string; mastery: number; parent_skill: number; access_level: number; cost: string; cost_value: number; background_color: number[]; font_color: number[]; description: string; required_skills: number[]; }'</code></p>
  <p>I want to be able to call the function like this:</p>
  <pre><code>edit(myObject, &quot;first&quot;, &quot;oneProperty&quot;, &quot;newValue1&quot;);
  </code></pre>
  <p>And the result would be that my &quot;first&quot; item in myObject would have &quot;newValue1&quot; for its &quot;oneProperty&quot; property.</p>
  <p>More informations:
  My object list</p>
  <pre><code>type SkillList = {
    [key: string]: Skill;
  };
  </code></pre>
  <p>My object</p>
  <pre><code>type Skill = {
    name: string;
    mastery: number;
    parent_skill: number;
    access_level: number;
    cost: string;
    cost_value: number;
    background_color: number[];
    font_color: number[];
    description: string;
    required_skills: number[];
  };
  </code></pre>