I am passing an array via ejs with JavaScript. I can get to the values inside ejs but not from JavaScript. Below is more information.
node.js
FileTypes = {"application/octet-stream":20,
"audio/mpeg":12,
"text/html" :71}
res.render('index.ejs', {FileTypes: JSON.stringify(FileTypes)});
index.ejs
<script type="text/javascript">
var FileTypes = <%=FileTypes%>;
//Error message on the console - Uncaught SyntaxError: Unexpected token &
</script>
Any ideas?