title: Accessing python list in javascript as an array
body: <p>I have this in my flask views.py</p>
  
  <pre><code>    def showpage():
        ...
        test = [1,2,3,4,5,6]
        return render_template("sample.html",test=test)
  </code></pre>
  
  <p>I have this in my sample .html</p>
  
  <pre><code>    &lt;script&gt; var counts = {{test}}; &lt;/script&gt;
  </code></pre>
  
  <p>This gives me a empty counts variable. How can I get the counts same as the test list in python?</p>