Why doesn't this work?
music.js
var files = fs.readdirSync('public/mymusic');
view.render('music', {mydata: files});
music.jade
script(type='text/javascript').
for (var i=0; i<mydata.length; i++) {
console.log(mydata[i]);
}
ReferenceError: mydata is not defined
This link seems to say I need to stringify and then parse the object, but then I no longer have the original array. how to pass an array of objects to jade template?