title: Merge items from two arrays based on matching ID
body: <p>I have a data object like this :</p>
  
  <pre><code>{
    "data1": [
      [
        "ID",
        "name",
        "Birthday"
      ],
      [
        "10",
        "thomas",
        "1992-03-17"
      ],
      [
        "11",
        "Emily",
        "2000-03-03"
      ]
    ],
    "data2": [
      [
        "Balance",
        "ID"
      ],
      [
        "$4500",
        "10"
      ],
      [
        "$1500",
        "13"
      ]
    ]
  }
  </code></pre>
  
  <p>It contains two arrays <code>data1</code> and <code>data2</code>.
  The first row in each array is the name of the columns and the rest of the rows have the data (think of it like a table).</p>
  
  <p>I want to compare the <code>ID</code> field in both arrays and if the <code>ID</code>s match then the final output will contain a column <code>Balance</code> with the balance corresponding to that <code>ID</code> and if the <code>ID</code>s don't match then the <code>Balance</code> will be <code>$0</code>.</p>
  
  <p>Expected output:</p>
  
  <pre><code>{
    "output": [
      [
        "ID",
        "name",
        "Birthday",
        "Balance"
      ],
      [
        "10",
        "thomas",
        "1992-03-17",
        "$4500" //ID 10 matched so the balance added here
      ],
      [
        "11",
        "Emily",
        "2000-03-03",
        "0" //0 bcoz the ID 11 is not there in data2 array
      ]
    ]
  
  }
  </code></pre>
  
  <p>I find this challenging to accomplish. Think of it like a LEFT-JOIN in MySQL.
  I referred to this <a href="https://stackoverflow.com/questions/32965688/comparing-two-arrays-of-objects-and-exclude-the-elements-who-match-values-into">solution</a> but it doesn't work in my case as I don't have the keys in my response.</p>
  
  <p><strong>EDIT</strong>: I also need to join the other fields as well.</p>