title: Call function into an Array structure
body: <p>i'm trying to generate an array from a function in typescript.
  My array looks like this: </p>
  
  <pre><code>model = {
    roles: { 4: true }
  };
  </code></pre>
  
  <p>i need to change the values 4 with a function that generate values automatically. 
  My function looks like this: </p>
  
  <pre><code>getIndex(data) {
    data.forEach(function (value) {
      return value['id'];
    });
  }
  </code></pre>
  
  <p>i tried something like this but it didn't work and i have an error: </p>
  
  <pre><code>model = {
    roles: { getIndex(dataValues): true }
  };
  </code></pre>
  
  <p>i want my array to looks like this from my function</p>
  
  <pre><code>model = {
    roles: { 4: true, 5: true, 7: false }
  };
  </code></pre>
  
  <p>can anyone help me with that? thank you in advance guys ^^</p>