title: JavaScript - Compare two arrays
body: <p>I have seen many posts about how to compare two arrays in JavaScript and do something if you find a match.
  I wanted to know how to write the opposite.
  I have two arrays and I want to do something when I don't find a match.</p>
  
  <pre><code>var a = [1,2,3,5];
  var b = [4,7,5,5];
  
  
  for(i=0;i&lt;a.length;i++){
      for(j=0;j&lt;b.length;j++){
         if(b[j]===a[i]){
            //do something
         }
     }
   }
  
   //somehow return 4, 7
  </code></pre>
  
  <p>Basically, I would like to find the reverse of the above.  If I dont find a match I would like to perform an action.  Where would my else statement go?  </p>
  
  <pre><code>   loop1:                                                                                          
          for(var i=0;i&lt;a.length;i++){                                                                                                                        
              loop2:                                                                                        
              for(var j=0;j&lt;b.length;j++){                                                                         
                  if(b[j]==a[i]){                                          
                      console.log("break loop");                                                            
                      break loop2;                                                                          
                  }                                                                                         
                  else{                                                                                     
                      continue loop1;                                                                              
                  }                                                                                         
              }                                                                                             
          }
  </code></pre>
  
  <p>This is as far as I've gotten, am I on the right track?</p>