title: Cannot read property of undefined in Jade
body: <p>I wrote a small jade script that is </p>
  
  <pre><code>ul.sidebar-nav
    each(record in #{records})
      li
        a(href='#') #{record.sender} 
  </code></pre>
  
  <p>I am passing a records array object to the jade template, but getting undefined for <code>record</code>. Can anyone please explain why I am getting this error?</p>
  
  <p>Here is the full error:</p>
  
  <pre><code>/home/ritesh/Sample/Sample1/Sample/views/index.jade:9 7| each(record in #{records}) 8| li &gt; 9| a(href='#') #{record.sender} 10| Cannot read property 'sender' of undefined
  
  TypeError: /home/ritesh/Sample/Sample1/Sample/views/index.jade:9
      7|         each(record in #{records})
      8|           li
    &gt; 9|             a(href='#') #{record.sender}         
      10| 
  
  Cannot read property 'sender' of undefined
      at eval (eval at &lt;anonymous&gt; (/home/ritesh/Sample/Sample1/Sample/node_modules/jade/lib/index.js:216:8), &lt;anonymous&gt;:83:49)
      at eval (eval at &lt;anonymous&gt; (/home/ritesh/Sample/Sample1/Sample/node_modules/jade/lib/index.js:216:8), &lt;anonymous&gt;:110:22)
      at res (/home/ritesh/Sample/Sample1/Sample/node_modules/jade/lib/index.js:217:38)
      at Object.exports.renderFile (/home/ritesh/Sample/Sample1/Sample/node_modules/jade/lib/index.js:360:38)
      at View.exports.renderFile [as engine] (/home/ritesh/Sample/Sample1/Sample/node_modules/jade/lib/index.js:350:21)
      at View.render (/home/ritesh/Sample/Sample1/Sample/node_modules/express/lib/view.js:93:8)
      at EventEmitter.app.render (/home/ritesh/Sample/Sample1/Sample/node_modules/express/lib/application.js:530:10)
      at ServerResponse.res.render (/home/ritesh/Sample/Sample1/Sample/node_modules/express/lib/response.js:933:7)
      at /home/ritesh/Sample/Sample1/Sample/routes/index.js:13:7
      at /home/ritesh/Sample/Sample1/Sample/node_modules/mongojs/node_modules/mongodb/lib/mongodb/cursor.js:172:16   
  </code></pre>