title: Manipulating arrays and objects
body: <p>Bear with me as this is a problem that I am struggling with so I might not explain it very well!</p>
  
  <p>I have an array of values and two strings:
  e.g.</p>
  
  <pre><code>["5", "6"]
  "DEPOT_NAME",
  "DEPOT_ID"
  </code></pre>
  
  <p>I also have an array of objects (only one in this example but can be multiple):</p>
  
  <pre><code>[
   {
    columns: [
     {name: "DEPOT_ID"}, 
     {name: "DEPOT_NAME"}, 
     {name; "REGION_ID"}, 
     {name: "CREATED_DATE"}, 
     {name: "MODIFIED_DATE"}
    ],
    id: 1,
    rows: [
     {data: {DEPOT_ID: "0", DEPOT_NAME: "London", REGION_ID: "0", CREATED_DATE: "2016-05-03", MODIFIED_DATE: "2016-05-03"}}, 
     {data: {DEPOT_ID: "1", DEPOT_NAME: "Abbey Road", REGION_ID: "1", CREATED_DATE: "2016-05-03", MODIFIED_DATE: "2016-05-03"}}, 
     {data: {DEPOT_ID: "3", DEPOT_NAME: "Romford", REGION_ID: "3", CREATED_DATE: "2016-05-03", MODIFIED_DATE: "2016-05-03"}}, 
     {data: {DEPOT_ID: "5", DEPOT_NAME: "Bristol", REGION_ID: "5", CREATED_DATE: "2016-05-03", MODIFIED_DATE: "2016-05-03"}}, 
     {data: {DEPOT_ID: "6", DEPOT_NAME: "Croydon", REGION_ID: "6", CREATED_DATE: "2016-05-03", MODIFIED_DATE: "2016-05-03"}}
    ],
    title: "Depots"
   }
  ]
  </code></pre>
  
  <p>Using the values that I have I need to get the value for the <code>DEPOT_NAME</code> key that corresponds to the correct <code>DEPOT_ID</code> value. The array above can be used to find the correct depot ids I assume but then how would I go about get the value for the depot name?</p>
  
  <p>I hope I explained that ok, if you need more clarification I will try my best to make it clearer.</p>
  
  <p>Any help with this would be much appreciated.</p>
  
  <p>Thanks for your time.</p>