title: how can I push data in a matrix with angular 7
body: <p>this is the array of objects I have :</p>
  <pre><code> [
    {
     indicatorDatasource: &quot;trackingError&quot;, 
     un_an: 0,
     trois_ans: 0,
     cinq_ans: 0
    },
    {
     indicatorDatasource: &quot;annualisedFundPerformance&quot;,
     un_an: 19.749642029434945,
     trois_ans: 0.08025487443092949,
     cinq_ans: -3.819180707679881
    },
    {
     indicatorDatasource: &quot;volatility&quot;,
     un_an: 27.581656736670507,
     trois_ans: 17.12568099017286, 
     cinq_ans: 13.426711413441112
    }]
  </code></pre>
  <p><strong>I want to transform it like that :</strong></p>
  <pre><code>[
        [ 'trackingError', 'annualisedFundPerformance', 'volatility' ],
        [ '0', '19.749642029434945', '27.581656736670507'],
        [ '0', '3.819180707679881', '13.426711413441112' ]
   ]
  </code></pre>
  <p>So I create a variable <code>tableOptions : String[][]</code> then I added elements from <code>dataSourceObject</code> like that :</p>
  <pre><code>this.datasourceObject.forEach(element =&gt; {
    this.tableOptions[].push(element[&quot;indicatorDatasource&quot;])
  });
  this.datasourceObject.forEach(element =&gt; {
    this.tableOptions[].push[(element[&quot;un_an&quot;].toString())]
  });
  this.datasourceObject.forEach(element =&gt; {
    this.tableOptions[].push[(element[&quot;trois_ans&quot;].toString())]
  });
  this.datasourceObject.forEach(element =&gt; {
    this.tableOptions[].push[(element[&quot;cinq_ans&quot;].toString())]
  });
  </code></pre>
  <p>But it gives me an error <code>Error : An element access expression should take an argument</code>.
  Can anyone help me how to transform it in the format I want ?</p>