Currently, I have this code for copy data from my array in C# Model to javascript array.
var javascriptArray = [];
@foreach (var data in Model.Array)
{
@:javascriptArray.push(@Html.Raw(data));
}
but in result html I have many times
javasriptArray.push("string1");
javasriptArray.push("string2");
javasriptArray.push("string3");
...
Is there any other way to do this?
thx