title: covert my json Array to my json structure in reactjs
body: <p>I get the data from Backend which is given below. and have to manipulate the data as per the requirement. how to convert the following JSON Array format as per the requirement in ReactJS. the Json Data given below</p>
  <pre><code>[
      {
        &quot;date&quot;: &quot;2020-12-10&quot;,
        &quot;airline&quot;: &quot;Air asia&quot;,
        &quot;totalprice&quot;: 4180,
        &quot;departuretime&quot;: &quot;20:25&quot;
      },
      {
        &quot;date&quot;: &quot;2020-12-10&quot;,
        &quot;airline&quot;: &quot;Air asia&quot;,
        &quot;totalprice&quot;: 4180,
        &quot;departuretime&quot;: &quot;11:25&quot;
      },
      {
        &quot;date&quot;: &quot;2020-12-10&quot;,
        &quot;airline&quot;: &quot;Air asia&quot;,
        &quot;totalprice&quot;: 4180,
        &quot;departuretime&quot;: &quot;22:45&quot;
      },
      {
        &quot;date&quot;: &quot;2020-12-10&quot;,
        &quot;airline&quot;: &quot;Air india&quot;,
        &quot;totalprice&quot;: 4180,
        &quot;departuretime&quot;: &quot;06:10&quot;,
      },
      {
        &quot;date&quot;: &quot;2020-12-10&quot;,
        &quot;airline&quot;: &quot;Air india&quot;,
        &quot;totalprice&quot;: 4180,
        &quot;departuretime&quot;: &quot;13:50&quot;,
      },
      {
        &quot;date&quot;: &quot;2020-12-10&quot;,
        &quot;airline&quot;: &quot;Air india&quot;,
        &quot;totalprice&quot;: 4180,
        &quot;departuretime&quot;: &quot;07:05&quot;,
      }
  ]
  </code></pre>
  <p>convert the above data as per the following data</p>
  <pre><code>[
    {
      &quot;airline&quot;: &quot;Air asia&quot;,
      &quot;data&quot;: [
        {
          &quot;date&quot;: &quot;2020-12-10&quot;,
          &quot;totalprice&quot;: 5180,
          &quot;departuretime&quot;: &quot;20:25&quot;
        },
        {
          &quot;date&quot;: &quot;2020-12-10&quot;,
          &quot;totalprice&quot;: 4180,
          &quot;departuretime&quot;: &quot;11:25&quot;
        },
        {
          &quot;date&quot;: &quot;2020-12-10&quot;,
          &quot;totalprice&quot;: 4180,
          &quot;departuretime&quot;: &quot;22:45&quot;
        }
      ]
    },
    {
      &quot;airline&quot;: &quot;Air india&quot;,
      &quot;data&quot;: [
        {
          &quot;date&quot;: &quot;2020-12-10&quot;,
          &quot;totalprice&quot;: 4180,
          &quot;departuretime&quot;: &quot;06:10&quot;
        },
        {
          &quot;date&quot;: &quot;2020-12-10&quot;,
          &quot;totalprice&quot;: 4180,
          &quot;departuretime&quot;: &quot;13:50&quot;
        },
        {
          &quot;date&quot;: &quot;2020-12-10&quot;,
          &quot;totalprice&quot;: 4180,
          &quot;departuretime&quot;: &quot;07:05&quot;
        }
      ]
    }
  ]
  </code></pre>
  <p>How to convert the by the Javascript method ?</p>