title: Can a js script get a variable written in a EJS context/page within the same file
body: <p>As I wrote in the title, I'd like to get a value from a variable written into a ejs page/file, from a javascript file within the same page</p>
  
  <p>EJS:</p>
  
  <pre><code>&lt;% var test = 101; %&gt;
  </code></pre>
  
  <p>JS:</p>
  
  <pre><code>&lt;script&gt;
      var getTest = test;
  &lt;/script&gt;
  </code></pre>
  
  <p>Or what if I'd like to use a function (with parameter) written into a EJS file and use this function in a JS context where the parameter is given to the function from JS context</p>
  
  <p>EJS:</p>
  
  <pre><code>&lt;% function fn(par){ ... } %&gt;
  </code></pre>
  
  <p>JS:</p>
  
  <pre><code>&lt;script&gt;
     var test = 101;
     &lt;%&gt;fn(test)&lt;%&gt; 
  &lt;/script&gt;
  </code></pre>