Is it possible or is there a workaround to use Razor syntax within JavaScript that is in a view (cshtml)?
cshtml
I am trying to add markers to a Google map...
That will work fine, as long as it's in a CSHTML page and not an external JavaScript file.
The Razor template engine doesn't care what it's outputting and does not differentiate between or other tags.
However, you need to encode your strings to prevent XSS attacks.