title: move object properties in array
body: <p>I have the following object:</p>
  <pre><code>const obj = {
    a: 1,
    b: 2,
    c: 3,
    d: 4,
    condition: 'checked' // could be &quot;unckecked&quot; or anything else
    items: []
  }
  </code></pre>
  <p>and I want to check if the <code>condition === checked</code> then I will have to move <code>a</code> and <code>b</code> inside items like this:</p>
  <pre><code>const obj = {
    c: 3,
    d: 4,
    condition: 'checked' // could be &quot;unckecked&quot; or anything else
    items: [{
         a: 1,
         b: 2,
    }]
  }
  </code></pre>
  <p>I have tried splice and tried to loop through the object with <code>for(of)</code> but didn't manage to do it, any idea how?</p>