title: Why is this Array.length if else check not working?
body: <p><img src="https://i.stack.imgur.com/0Aemv.png" alt="enter image description here"></p>
  
  <p>Obviously <code>tagObjects</code> is an array and has a length of <code>0</code>. However it's still getting past that check and causes an error.</p>
  
  <p><strong>TypeError: Cannot read property 'length' of undefined</strong></p>
  
  <pre><code>if (tagObjects != "empty" || tagObjects.length === 0) {
      for (var i = 0; i &lt; tagObjects.tags.length; i++) {
          temp_tags.push(tagObjects[i].tags);
      }
  
      temp_tags.forEach(function(obj) {
          if (obj.selected) {
              if (vs.tags[map[obj.term]] != undefined) {
                  vs.tags[map[obj.term]].selected = true;
              }
          }
      });
  }
  </code></pre>
  
  <p>It's even getting past the string check!</p>
  
  <p><img src="https://i.stack.imgur.com/HsoKo.png" alt="enter image description here"></p>