title: How to pass an array object to Jade
body: <p>Why doesn't this work?</p>
  
  <p>music.js</p>
  
  <pre><code>var files = fs.readdirSync('public/mymusic');
  view.render('music', {mydata: files});
  </code></pre>
  
  <p>music.jade</p>
  
  <pre><code>script(type='text/javascript').
    for (var i=0; i&lt;mydata.length; i++) {
    console.log(mydata[i]);
    }
  </code></pre>
  
  <p>ReferenceError: mydata is not defined</p>
  
  <p>This link seems to say I need to stringify and then parse the object, but then I no longer have the original array.
  <a href="https://stackoverflow.com/questions/12960575/how-to-pass-an-array-of-objects-to-jade-template">how to pass an array of objects to jade template?</a></p>