title: C# Razor foreach loop syntax in Javascript
body: <p>I got the following javascript code from google chart:</p>
  
  <pre><code>function drawTimeChart() {
      var dataArray = generateTimeChartArray();
      var data = google.visualization.arrayToDataTable([
      ['2001', '25'],
        ['2002', 35],
        ['2003', 25],
        ['2004', 55]
      ]);
  
      var options = {
          title: 'Reported devices in MAUDE based on the term since 1990',
          backgroundColor: '#EFEEEF',
          hAxis: { showTextEvery: 4 }
      };
  
      var chart = new google.visualization.LineChart(document.getElementById('MaudeTimeChart'));
  
      chart.draw(data, options);
  }
  </code></pre>
  
  <p>The data that I insert into data i want to be dynamicly added. I tried doing like this:</p>
  
  <pre><code>var data = google.visualization.arrayToDataTable([
                  @foreach (var item in Model.NumberOfReportedRecords){
                      [@Html.DisplayFor(modelItem =&gt; item.year), @Html.DisplayFor(modelItem =&gt; item.Status)]
                   }
                  ]);
  </code></pre>
  
  <p>Anyone know how to make this work? </p>