title: ASP.NET MVC 3 Razor : Initialize a JavaScript array
body: <p>What would be the prefered way to initialize a JS array in ASP.NET MVC 3 with Razor with a value I have in my model/view model ?</p>
  
  <p>For example to initialize an array of strings representing dates : </p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
      var activeDates = ["7-21-2011", "7-22-2011"];
  &lt;/script&gt;
  </code></pre>
  
  <p>with </p>
  
  <pre><code>public class MyViewModel
  {    
    public DateTime[] ActiveDates { get; set; }
  }
  </code></pre>