title: Javascript: How to Iterate Object [Key: value] but skip some keys ([fastest way possible])
body: <p>If given a script like:</p>
  
  <pre><code> &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
  &lt;head&gt;
  &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt;
  &lt;title&gt;Test DOC&lt;/title&gt;
  
  &lt;script type="text/javascript" src="../nt_scr/jq_1.9.js"&gt;&lt;/script&gt;
  
  &lt;script type="text/javascript"&gt;
  
   var mainObj = { 0: {   "fruitName":"Lemon",
                          "fruitColor":"green",    
                          "fruitTaste":"bad"},
  
                   1:  {  "fruitName":"Mango",
                          "fruitColor":"Yellow",    
                          "fruitTaste":"Yammy"},
                   2:   {
  
  
                          "fruitName":"Banana",
                          "fruitColor":"Yellow",    
                          "fruitTaste":"Yammy"},
  
  
                  "skip_these":   
  
                       {
                          "team1":"Liverpool",
                          "team2":"Manchester United"
  
                          } 
  
  }
  
  var collect_data = $.parseJSON(JSON.stringify(mainObj)),
      getFruitNames=[],getFruitColors=[], getFruitTastes=[];
  
  $.each( collect_data,function(index,val){
  
       //console.log(val); //Un-comment this console.log to see the contents of 'val'
  
      //-----&gt;Here is the Challenge:,---------\\\
      if(/*How do you SKIP if val is something like */ "val.team1" || "val.team2"){
  
       getFruitNames.push(val.fruitName);
       getFruitColors.push(val.fruitColor);
       getFruitTastes.push(val.fruitTaste);
  
          //This works well so long as we have not yet reached the "skip_these":   
          //Once there, it reports an error because there is no "skip_these".fruitName or    "skip_these".fruitColor
          }
  
          console.log( getFruitNames[index])// Run a test out put :: NOTICE the "Undefined" in the Console. How to avoid that? 
          //To see well, Comment the previous console.log  &lt;&lt;the one on top&gt;&gt;
       })
  
  
  &lt;/script&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
  
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>I did this sometimes ago but somehow, my brain is just blank now.... Any suggestion is highly appreciated. (Please Run with your <code>jQuery</code>)</p>