title: Move an object (element) one step up with Javascript
body: <p>I have several objects like this:</p>
  
  <p><img src="https://i.stack.imgur.com/pxm4C.png" alt="enter image description here"></p>
  
  <p>I want to move <code>type</code> and <code>value</code> one step up so they will be next to <code>field</code>, and then delete <code>data</code>.<br>
  It looks like this when <code>departments</code> is converted to JSON:</p>
  
  <pre><code>[
      {"field"    : "DEPARTMAN_NO",
       "data"     : { "type":"numeric" , "comparison":"eq" , "value":11 }
      },
      {"field"    : "DEPARTMAN_ADI",
       "data"     : { "type":"string" , "value":"bir" }
      }
  ]
  </code></pre>
  
  <p>I have tried:</p>
  
  <pre><code>departments = grid.filters.getFilterData();
  i = {};
  for(var i in department) {
  department = i.data;
  delete.department.data;
  };
  </code></pre>
  
  <p>but it dosen't work.</p>