ViewData Array MVC Razor Javascript
// For ASP.NET
var monthLists = @Html.Raw(Json.Encode(ViewData["months"]));
// For ASP.NET CORE
var monthLists = @Html.Raw(Json.Serialize(ViewData["months"]));
Cheerful Crocodile