title: Length of empty array in javascript
body: <p>so i'm trying to do one of the most basic things, and i am wondering what's wrong with my approach.</p>
  
  <p>i have an object containing rooms</p>
  
  <pre><code>{ rooms: 
     { ijxeczyu: 
        { Id: 'ijxeczyu',
          teacherName: 'testteacher',
          teacherId: '/#Ikosyfr1NtDcpKbaAAAA',
          clients: [] } },
    getRooms: [Function],
    addRoom: [Function] }
  </code></pre>
  
  <p>now i want to render their info to a table in jade.
  for that to work, i want to extract the important stuff and push it to an array</p>
  
  <pre><code>function makeArray(obj) {
  
    var roomArray = [];
  
    for (var room in obj) {
      roomArray.push({
        roomId  : room.Id,
        teacher : room.teacherName,
        clients : room.clients.length || 0
      })
    }
    return roomArray;
  }
  </code></pre>
  
  <p>pretty easy.
  <strong>but</strong> i can't get that empty clients array to work.
  <code>TypeError: Cannot read property 'length' of undefined</code>
  isn't that exactly what the <code>|| 0</code>part should catch?</p>
  
  <p>why doesn't this work? how can i read the length of an array or <code>0</code> if there are no entries?</p>