title: How to Combine or Merge Object Array with Object Array Jquery
body: <p>i have an object like this in my console:</p>
  <pre><code>ObjectName1 : Array(3)
  0 : { id : 1, name : 'foo' },
  1 : { id : 2, name : 'foo-2' },
  2 : { id : 3, name : 'foo-3' },
  
  ObjectName2 : Array(3)
  0 : { id : 1, foo : 'bar' },
  1 : { id : 2, foo-2 : 'bar-2' },
  2 : { id : 3, foo-3 : 'bar-3' },
  </code></pre>
  <p>and as usually if we want to get the name, just write : <code>ObjectName1[key].name</code> right ?</p>
  <p>now if i want to get the <code>key</code> from <code>ObjectName2</code> (foo, foo-2, foo-3) how to get the <code>key</code> from <code>ObjectName2</code> using the <code>value</code> from <code>ObjectName1</code> ?</p>
  <p>i have written like this :</p>
  <pre><code>// just say there is an each above this comment
       var name = ObjectName1[key].name;
       var bar  = ObjectName2[key]+&quot;.&quot;+name;
  // end each 
  </code></pre>
  <p>but it just showed</p>
  <blockquote>
  <p>[Object object].foo</p>
  <p>[Object object].foo-2</p>
  <p>[Object object].foo-3</p>
  </blockquote>
  <p>the output should be like this :</p>
  <pre><code>bar
  bar-2
  bar-3
  </code></pre>
  <p>it is possible doing like i want to do ? help me please if it is possible</p>
  <p>any help will be very appreciated.</p>
  <p>*note : i'm not sure what is the case name in my problem, so forgive me if the title went wrong</p>
  <p>thanks</p>