title: Alternatives to nested for loops in Javascript
body: <p>I need to take an element in array one, and compare it to every other element of array two to see if there's a match.  I need to do this for every element in array one.</p>
  
  <pre><code>for ( let i = 0, j = userArray.length; i &lt; j; i++) {
              for ( let c = 0, d = userArray.length; c &lt; d; c++) {
                object = {
                  id: userArray[i].account,
                  name: userArray[i].name,
                  title: "",
                  rating: ""
                }
  
                if ( userArray[i].account === accountArray[c].id) {
  
                  object.title = accountArray[c].title.title
  
                }
  
                if (object.title !== ""){
                  objectArray.push(object)
  
                }
  
              }
  
            }
  </code></pre>
  
  <p>is there a more efficient approach to this.</p>
  
  <p>the desired outcome is to compare every element of accountArray to each individual element of userArray to search for matches</p>