title: Is there a better way to skip undefined variables in a loop?
body: <p>I'm writing a loop that runs a bunch of functions on some nodes in an object. If the objects are undefined, they should be ignored, unless a flag, m.testUndefined is true, then the opposite is true. My logic below works, but I wonder if there is a less wordy and more explcit way of achieving the same thing.</p>
  
  <pre><code>for (var i = tests.length - 1; i &gt;= 0; i--) {
      var m = tests[i],
      subject = m.subject(raw),                       //get the right raw data
      isUndefined = typeof subject === 'undefined';
  
      if(m.testUndefined &amp;&amp; !isUndefined){            //Flag for skipping defined subjects
          continue;
      }else if(!m.testUndefined &amp;&amp; isUndefined){      //Skip all other undefined subjects.
          continue;
      }
  
      if( m.test(subject, m.params) ){
          m.tag(item.tags);                           //add tags if test success
      }
  }
  </code></pre>