title: Is there some way I can "join" the contents of two javascript arrays much like I would do a join in SQL
body: <p>I have two arrays: Question and UserProfile</p>
  <ul>
  <li>The <code>userProfiles</code>: [] array contain <code>{ id, name }</code> objects</li>
  <li>The <code>questions</code>: [] array contains <code>{ id, text, createdBy }</code> objects</li>
  </ul>
  <p>The <code>createdBy</code> integer in questions is always one of the id values in <code>userProfiles</code>.</p>
  <p>Is there a way I could &quot;join&quot; the arrays in much the same way as I would join up two SQL tables if I was using a database.</p>
  <p>What I need as an end result is an array that contains</p>
  <pre><code>{ id, text, name }
  </code></pre>
  <p>Corresponding SQL would be:</p>
  <pre><code>SELECT u.id, q.text, u.name 
  FROM userProfiles u 
  JOIN questions q ON q.createdBy=u.id
  </code></pre>