Instead of trying to treat the data as a string in the JS and parsing it again, you can just inject the value direct into the JS as an array literal. Since JSON is a subset of JS object literal syntax, it'll just be treated as a literal. Don't think you even need the Html.Raw()
command.
Try simply
var SheetsArr = @Model.Sheets;
(I'm assuming here that in the C# you assigned the C# SheetsArr
variable to the Sheets
property of your model before you returned it.)
Then this removes the issue where your single-quoted string in JS is mucked up by single quotes within the JSON string.
To illustrate the point, let's say that Model.Sheets
contains a JSON string like this:
[{ "SomeProp": "Hello, 'Friend'"}, { "SomeProp": "Hello again"}]
You can see the single quote marks.
In your original code, executing the Razor code with that string in it would result in the following JavaScript:
var SheetsArr = JSON.parse('[{ "SomeProp": "Hello, 'Friend'"}, { "SomeProp": "Hello again"}]');
As you can see, the single quotes in the middle are now a problem because they terminate the outer string literal quotes.
Whereas if we just inject the JSON directly in the way I've suggested, the resulting JS is this (I've added the console command just so you can see the result):
var SheetsArr = [{ "SomeProp": "Hello, 'Friend'"}, { "SomeProp": "Hello again"}];
console.log(SheetsArr);