title: Check for Not Matching words between strings
body: <p>Here is a code that will output all the matching words in both strings if you log <strong>words1[i]</strong>.I changed the code a little bit to check for not matching words with no success. let's assume we have two strings:</p>
  
  <pre><code>var str1 = "world is beautiful";
  var str2 = "is world butiful";
  </code></pre>
  
  <p>Then the output of the code will be (on console):</p>
  
  <p>(2) ["is", "beautiful"]</p>
  
  <p>(2) ["world", "beautiful"]</p>
  
  <p><strong>How we can log Not Matching words between strings?</strong></p>
  
  <p>The output should be an array of results, something like:</p>
  
  <p>[beautiful]</p>
  
  <p>Here is what I've tried:</p>
  
  <pre><code>var str1 = "world is beautiful";
  var str2 = "is world bautiful";
  
  var words1 = str1.split(/\s+/g),
      myArray = str1.split(/\s+/g),
      words2 = str2.split(/\s+/g),
      i,
      j;
  
  for (i = 0; i &lt; words1.length; i++) {
      for (j = 0; j &lt; words2.length; j++) {
          if (words1[i].toLowerCase() == words2[j].toLowerCase()) {
  
          output = myArray.filter( ( el ) =&gt; !words1[i].includes( el ) );
          console.log(output);   
  
          }
      }
  }
  </code></pre>
  
  <p>It seems because <strong>words1[i]</strong> is not an <strong>array</strong> the whole code doesn't work.</p>
  
  <p>Any suggestions? </p>