title: Display JSON data members with one and more objects
body: <p>I have written a JavaScript to display data from JSON object. member <strong><em>employeeType</em></strong> has two <strong><em>employees</em></strong> members; one contains an array containing 3 <strong><em>employee</em></strong> objects, each containing three members and one has 3 members which are "employee", "id" and "email". I am able to display the members if a member has more than one objects but I am unable to display members of an object if the object is alone in employees. I might be unclear to explain it but you can have a look at this <a href="http://jsfiddle.net/HASuY/" rel="nofollow noreferrer">fiddle here</a>. </p>
  
  <p>My JSON looks like this;</p>
  
  <pre><code>var data = {"employeeSearch":{"employeeType":[{"employees":[{"employee":"name1", "id":"1", "email":"name1@company.com"},{"employee":"name2", "id":"2", "email":"name2@company.com"},{"employee":"name3", "id":"3", "email":"name3@company.com"}]},{"employees":{"employee":"name4", "id":"4", "email":"name4@company.com"}}]}};
  </code></pre>
  
  <p>This script display the data</p>
  
  <pre><code>for(var i = 0; i &lt; data.employeeSearch.employeeType.length; i++) {
      for (var j = 0; j &lt; data.employeeSearch.employeeType[i].employees.length; j++) {
          countItem++;
          output += "&lt;tr&gt;&lt;td&gt;"+ countItem +"&lt;/td&gt;" + 
                  "&lt;td&gt;"+ data.employeeSearch.employeeType[i].employees[j].employee + "&lt;/td&gt;" + 
                  "&lt;td&gt;"+ data.employeeSearch.employeeType[i].employees[j].id +"&lt;/td&gt;" + 
                  "&lt;td&gt;"+ data.employeeSearch.employeeType[i].employees[j].email +"&lt;/td&gt;&lt;/tr&gt;";
      }
  }
  return output;
  </code></pre>
  
  <p>This is how it looks in JsonViews</p>
  
  <p><img src="https://i.stack.imgur.com/hxGDO.png" alt="enter image description here"></p>
  
  <p>Now how can I display the last employee object? Please point me in the right direction and explain what wrong I am doing and what should I do. </p>
  
  <p><a href="http://jsfiddle.net/HASuY/" rel="nofollow noreferrer">JSFiddle</a></p>