title: Why does JavaScript map function return undefined?
body: <p>My code</p>
  <pre><code> var arr = ['a','b',1];
   var results = arr.map(function(item){
                  if(typeof item ==='string'){return item;}  
                 });
  </code></pre>
  <p>This gives the following results</p>
  <pre><code>[&quot;a&quot;,&quot;b&quot;,undefined]
  </code></pre>
  <p>I don't want <code>undefined</code> in the results array. How can I do it?</p>