I have the following :
ViewBag.SomeEnumerable = new List<string>() { "string1", "string2" };
Now how do I assign ViewBag.SomeEnumerable
to an array
or some form of enumerable object on the JavaScript side? e.g.:
function SomeFunction()
{
var array = @ViewBag.SomeEnumerable;
for(var eachItem in array)
{
alert(eachItem); // should display "string1" then string2"
}
}