title: Use Javascript value in Twig
body: <p>My question is similar to this one:</p>
  
  <p><a href="https://stackoverflow.com/questions/19164995/variable-twig-in-javascript">variable Twig in Javascript</a></p>
  
  <p>Except that I want to use a variable (value) from a Javascript to use with Twig</p>
  
  <p>I have this simple script:</p>
  
  <pre><code>&lt;script type="text/javascript" charset="utf-8"&gt;
  var test = "1";
  &lt;/script&gt;
  </code></pre>
  
  <p>I want to use that <strong>var test</strong> variable with my Twig page, to compare with another value that I already set in my controller and can use in the Twig page.</p>