Sure, just make sure to properly encode it. For example you could JSON encode the entire model itself:
@model IEnumerable<MyViewModel>
<script type="text/javascript">
var model = @Html.Raw(Json.Encode(Model));
// at this stage the model javascript variable represents the JSON encoded
// value of your server side model so that you can access all it's properties:
alert(model.length);
</script>
or:
alert(model[2].Foo.Bar);
or whatever.
But if you only care about the number of elements inside the model (if this model represents a collection):
var count = @Html.Raw(Json.Encode(Model.Count()));
alert(count);