title: Pass array to view without html encoding issue node js(handlebars)
body: <p>I am making a call to the yahoo finance api which is returning a csv. I then want to convert the csv file to an array which google charts can read. The issue is when I pass the array to the view it has a bunch of html encoded characters. </p>
  
  <p>For example I want to pass the array:</p>
  
  <pre><code>[['Year', 'Sales', 'Expenses'],['2004',1000,400],['2005',1170,460],['2006',660,1120],['2007',1030,540]]
  </code></pre>
  
  <p>But when the page is rendered it is throwing an error and the passed array looks like this:</p>
  
  <pre><code>[[&amp;#x27;Year&amp;#x27;, &amp;#x27;Sales&amp;#x27;, &amp;#x27;Expenses&amp;#x27;],[&amp;#x27;2004&amp;#x27;,1000,400],[&amp;#x27;2005&amp;#x27;,1170,460],[&amp;#x27;2006&amp;#x27;,660,1120],[&amp;#x27;2007&amp;#x27;,1030,540]]
  </code></pre>
  
  <p>Here is my index.js:</p>
  
  <pre><code>var router = require('express').Router();
  
  function GetCompanyInformation(callback) {
      var request = require('request');
      request('http://table.finance.yahoo.com/table.csv?s=orcl&amp;a=0&amp;b1&amp;c=2010&amp;d=0&amp;e=1&amp;f=2011&amp;g=d&amp;y=0&amp;z=orcl', function (error, response, data) {
          if (!error &amp;&amp; response.statusCode == 200) {
              return callback(null,data);
          }
          return callback('An error has occurred.',null);
      })
  }
  
  /* GET home page. */
  router.get('/', function(req, res, next) {
      GetCompanyInformation(function(err, data){
          res.render('index', {
              title: 'Express',
              data : "[['Year', 'Sales', 'Expenses'],['2004',1000,400],['2005',1170,460],['2006',660,1120],['2007',1030,540]]"
          });
      });
  });
  module.exports = router;
  </code></pre>
  
  <p>Here is my view:</p>
  
  <pre><code>&lt;div class="container"&gt;
      &lt;div class="row"&gt;
          &lt;h1&gt;{{ title }}&lt;/h1&gt;
          &lt;hr&gt;
          &lt;div id="stock-chart-container" class="col-lg-12"&gt;
              &lt;h3&gt;Item Name&lt;/h3&gt;
              &lt;hr&gt;
              &lt;div id="company-performance-chart"&gt;&lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  
  &lt;script type="text/javascript"&gt;
      google.charts.load('current', {'packages':['corechart']});
      google.charts.setOnLoadCallback(drawChart);
      function drawChart() {
  
      var data = google.visualization.arrayToDataTable({{data}});
  
          var options = {
              chart: {
                  title: 'Company Performance',
                  subtitle: 'Sales, Expenses, and Profit: 2014-2017',
              }
          };
  
          var chart = new google.charts.Bar(document.getElementById('company-performance-chart'));
  
          chart.draw(data, options);
      }
  
      &lt;!--RESIZE THE GOOGLE CHART (MAKES IT RESPONSIVE)--&gt;
      $(window).resize(function(){
          drawChart();
      });
  &lt;/script&gt;
  </code></pre>
  
  <p>The value that needs to be passed over to the google charts needs to look like this:</p>
  
  <pre><code>var data = google.visualization.arrayToDataTable([
      ['Year', 'Income', 'Expenses', 'Profit'],
      ['2014', 1000, 400, 200],
      ['2015', 1170, 460, 250],
      ['2016', 660, 1120, 300],
      ['2017', 1030, 540, 350]
  ]);
  </code></pre>
  
  <p>Am I approaching this the wrong way?</p>
  
  <p>@James When I pass it as an array i get this in the rendered view:</p>
  
  <pre><code>var data = google.visualization.arrayToDataTable(Year,Sales,Expenses,2004,1000,400,2005,1170,460,2006,660,1120,2007,1030,540);
  </code></pre>