title: Create a new array of object from 2 other objects
body: <p>I am trying to create a new array of objects from data in 2 other objects(one of them is an array). 
  First object i have is a simple key:value one which contains a record values.</p>
  
  <pre><code>const records = {
    title: 'My title',
    body: 'bla bla bla',
    created_at: 'some date'
  };
  </code></pre>
  
  <p>The second is an array of object which holds field properties like the type and mandatory.</p>
  
  <pre><code>const fields = [
    {
      name: 'title',
      type: 'TextField',
      mandatory: true
    },
    {
      name: 'body',
      type: 'RichTextField',
      mandatory: false
    },
    {
      name: 'created_at',
      type: 'DateField',
      mandatory: true
    }
  ];
  </code></pre>
  
  <p>I am trying to search for every key on the first object and get the other properties in the second array. Basically I want something like this:</p>
  
  <pre><code>const newArray= [
    { name: title, value: 'My title', type: 'TextField', mandatory: true },
    { name: body, value: 'bla bla bla', type: 'RichTextField', mandatory: false },
    { name: created_at, value: 'some date', type: 'DateField', mandatory: true }
  ];
  </code></pre>