title: javascript simple count in object?
body: <p>Sorry I'm a new student, sorry this is so simple yet I still do not understand the object even after some research.</p>
  
  <pre><code>var obj = [
      {day:"monday", status:"present" , reason:""},
      {day:"tuesday", status:"present" , reason:""},
      {day:"wednesday", status:"absence" , reason:"sick"},
  
    ]
  </code></pre>
  
  <p>to be like this :</p>
  
  <pre><code>Total days: 3 
  Total present: 2 
  Total absence: 1 
  </code></pre>
  
  <p>do i have to use iteration ?</p>
  
  <pre><code>for (var key in obj) {
      var currentObj = obj[key];
  }
  var totaldays = obj.length ;
  console.log(totaldays);
  </code></pre>
  
  <p>and why  <code>var totaldays = obj.length ;</code> didnt work without iteration ?</p>
  
  <p>also #2 question</p>
  
  <pre><code>{day:"monday", status:"present" , reason:""},
  </code></pre>
  
  <p>and</p>
  
  <pre><code>{"day":"monday", "status":"present" , "reason":""},
  </code></pre>
  
  <p>are those same or not ? sorry i feel like more understand with questioning in person/community rather than read in w3school or another cause I've tried over and over again and still get confused.
  but I always read first, asking is my last option</p>