title: convert object to array of object
body: <p>I have data from backend like this :</p>
  <pre><code> const fetchResult = { 
              cmo: 'integrated', 
              schedule1: '2021-08-12', 
              schedule2: '2021-09-20', 
              kendaraan: {}, 
              kubikasi1: 207000, 
              kubikasi2: 20000,
              status_so1: true,
              status_so2: false,
  }
  
  </code></pre>
  <p>what i expected :</p>
  <pre><code>const result = [
    {
      schedule: value,
      kubikasi: value,
      status_so: true
    },
    {
      schedule: value,
      kubikasi: value,
      status_so: false
    },
  ]
  
  </code></pre>
  <p>basically i want to format json from backend to array of objects and i want to group it, based on what expected result. and data for example like <code>schedule</code> from the api can be dynamic like <code>schedule6</code>.</p>
  <p>what i already tried</p>
  <pre><code>for (let i = 1; i &lt;= 4; i++) {
          if (cmo[&quot;schedule_&quot; + i]) {
            data.push({
              schedule: cmo[&quot;schedule_&quot; + i],
              namakendaraan: cmo[&quot;namakendaraan&quot; + i],
              kendaraan: cmo[&quot;kendaraan&quot; + i],
              totalCarton: cmo[&quot;totalCarton&quot; + i],
              tonase: cmo[&quot;tonase_&quot; + i],
              totalTonaseKendaraan: cmo[&quot;totalTonaseKendaraan&quot; + i],
              totalPercentaseTonaseOrder: cmo[&quot;totalPercentaseTonaseOrder&quot; + i],
              kubikasi: cmo[&quot;kubikasi_&quot; + i],
              totalKubikasiKendaraan: cmo[&quot;totalKubikasiKendaraan&quot; + i],
              totalPercentaseKubikasiOrder:
                cmo[&quot;totalPercentaseKubikasiOrder&quot; + i],
              nomor_so: cmo[&quot;nomor_so_&quot; + i],
              status_so: cmo[&quot;status_so_&quot; + i],
            });
          } else {
            data.push({
              schedule: null,
              namakendaraan: null,
              kendaraan: null,
              totalCarton: null,
              tonase: null,
              totalTonaseKendaraan: null,
              totalPercentaseTonaseOrder: null,
              kubikasi: null,
              totalKubikasiKendaraan: null,
              totalPercentaseKubikasiOrder: null,
              nomor_so: null,
              status_so: null,
            });
          }
  </code></pre>