razor list to js array code example
Example: razor list to js array
<script>
var myArray = [];
@foreach (var d in Model.data)
{
// Using the @: operator
//we can use javascript variables in razor C#
@:myArray.push("@d");
}
</script>