title: Searching a string for missing letters of the alphabet in javascript
body: <p>I'm working on a bit of code that will search through a string and return any letters of the alphabet that are missing. This is what I have:</p>
  
  <pre><code>function findWhatsMissing(s){
      var a = "abcdefghijklmnopqrstuvwxyz";
      //remove special characters
      s.replace(/[^a-zA-Z]/g, "");
      s = s.toLowerCase();
      //array to hold search results
      var hits = [];
  
      //loop through each letter in string
      for (var i = 0; i &lt; a.length; i++) {
          var j = 0;
          //if no matches are found, push to array
          if (a[i] !== s[j]) {
                  hits.push(a[i]);
          }
          else {
              j++;
          }
      }
      //log array to console
      console.log(hits);
  }
  </code></pre>
  
  <p>But using the test case:
  findWhatsMissing("d a b c");</p>
  
  <p>Results in all the letters before d being added to the missing array.</p>
  
  <p>Any help would be greatly appreciated.</p>