title: How to remove 'undefined' on Object.keys for forEach
body: <p>Hi Im using node Js and im having a problem on <code>forEach</code> on <code>Object.keys</code>, in the code below when i try to run it, there was an undefined value on the first value of output. For example lets say the value of input variable is:</p>
  
  <pre><code>input = [dog, cat, mouse, horse, pig];
  </code></pre>
  
  <p>Then when the program runs (refer the code below..) The value of <code>val</code> (with the <code>forEach</code> loop and <code>Object.keys</code>) is</p>
  
  <p><code>val</code> = undefined dog plus the animal cat  plus the animal mouse  plus the animal horse plus the animal pig </p>
  
  <p>I hope you guys understand my question, Thanks.</p>
  
  <pre><code>    var input = JSON.parse(JSON.stringify(req.body));
      var val;
      Object.keys(input).forEach(function(key) {
          if(key!='undefined')
          {
            val +=' '+key+' plus the animal';
          }
      });
      console.log(val);
  </code></pre>