title: Create new array depending of the number of properties in another object in Javascript
body: <p>I have an object and depending of the number of properties in that, I need to create a new array.</p>
  <pre><code>const data = {
      name: 'John Doe',
      company:'Google'
  }
  </code></pre>
  <p>So, the new array should be like this:</p>
  <pre><code>const array = [
      0: {
          id: 3434,
          fileId: name, //from data
          criter: 'John Doe;
          address: '12345'
      }
      1: {
          id: 4233,
          fileId: company, //from data
          criter: 'Google;
          address: '32344'
      }
  ]
  </code></pre>
  <p>I have tried to create array and to use Object.keys and Object.values to get the data, but I'm not achieving this.</p>
  <pre><code> const testArray = [{
      criter: Object.values(data).map(key =&gt; key),
      fileId: Object.keys(data).map(key =&gt; key)',
    }];
  </code></pre>