title: Add string to push method
body: <p>I want to dynamically add string to push method in array. If you look at the expected below, you would find <code>render: function(data, type, row) {...}</code> in <code>&quot;% Change&quot;</code> column. I want to add string based on column name which is <code>% Change</code> in this case. When I am using <code>Object.keys( )</code> order of column names is also different than the original array.</p>
  <pre><code>var columns= [];
  
  const overallTradeAnnual = [{
    &quot;Period&quot;: &quot;Export&quot;,
    &quot;2020&quot;: 276.2,
    &quot;2019&quot;: 324.3,
    &quot;% Change&quot;: -14.8
  }, {
    &quot;Period&quot;: &quot;Import&quot;,
    &quot;2020&quot;: 371.9,
    &quot;2019&quot;: 486.1,
    &quot;% Change&quot;: -23.5
  }];
  
  columnNames = Object.keys(overallTradeAnnual[0]);
  
  for (var i in columnNames) {
    columns.push({
      data: columnNames[i],
      title: columnNames[i]
    });
  }
  
  console.log(columns);
  </code></pre>
  <p><strong>Output I am getting</strong></p>
  <pre><code>[{
    data: &quot;2019&quot;,
    title: &quot;2019&quot;
  }, {
    data: &quot;2020&quot;,
    title: &quot;2020&quot;
  }, {
    data: &quot;Period&quot;,
    title: &quot;Period&quot;
  }, {
    data: &quot;% Change&quot;,
    title: &quot;% Change&quot;
  }]
  </code></pre>
  <p><strong>Expected Output</strong></p>
  <pre><code>[{
    data: &quot;Period&quot;,
    title: &quot;Period&quot;
  }, {
    data: &quot;2019&quot;,
    title: &quot;2019&quot;
  }, {
    data: &quot;2020&quot;,
    title: &quot;2020&quot;
  }, {
    data: &quot;% Change&quot;,
    title: &quot;% Change&quot;,
    render: function(data, type, row) {
  
      if (!data) {
        return '-';
      }
      if (data &lt; 0) {
        return '&lt;span style=&quot;color: red;&quot;&gt;' + data + '%' + '&lt;/span&gt;';
      }
      if (data &gt; 0) {
        return '&lt;span style=&quot;color: green;&quot;&gt;' + '+' + data + '%' + '&lt;/span&gt;';
      }
      return '&lt;span style=&quot;color: #62dd62;&quot;&gt;' + data + '%' + '&lt;/span&gt;';
    }
  }]
  </code></pre>