The Visual Studio debugger actually expects debugging of the actual server-side code in your .cshtml file, unlike the client-side Javascript inside it.
IIRC, Visual Studio will allow you to debug Javascript code, as expected in Internet Explorer (and possibly Edge), but for other browsers you most likely want to use a third-party tool or developer tools (F12) in your browser.
A simple approach would be to use the Javascript debugger keyword, which you can put into your code and run using the developer tools to open (just press F12 and then refresh the page). It will hit a breakpoint, and the browser will allow you to execute your code, as you might expect:
function doWork(){
source share