title: res.render send data to EJS file and using it in plain javascript
body: <p>I have this next GET function in express and in the <code>res.render()</code> function i'm sending to the EJS file the data i want to use, now my question is how can i use the data that i've sent to the EJS file in plain javascript in the same EJS file?
  GET Funtion: </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>router.get('/:id', (req, res) =&gt; {
   let pollId = req.params.id;
   Poll.findById(pollId, (err, poll) =&gt; {
    if(err) throw err;
    Vote.find(pollId, (err, votes) =&gt; {
     res.render('vote', {user: req.user, poll: poll, voteFail: req.flash('voteFail'),votes: votes });
    });
   });
  });</code></pre>
  </div>
  </div>
  </p>
  
  <p>And an example of how i want to use the data:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>&lt;script type="text/javascript"&gt;
    console.log(&lt;%votes%&gt;);
  &lt;/script&gt;</code></pre>
  </div>
  </div>
  </p>