How to debug code (JavaScript)

Is there something in Unity for stopping the code while it is executing in some pre-determined points and then verify the value of whatever variables at that time and then keep on moving? Something like what VBA for Excel has.

I ask this because I want to do something in the Update() function, but it doesnt do what I want, but when I try to see what is going on, the Update function doesnt stop, all I can get is whatever I put in the log.

Is not any way of stopping it (other than the stop or pause button) and check what the current values are?

As well as using Debug.Break() to pause the editor, you can also switch the Inspector pane to "Debug Mode" which shows up all the variable values for the selected object, including private vars, so you can examine their values.

To switch the Inspector pane to Debug mode, look for the small dropdown menu icon to the left of the "Inspector" tab, at the very top of the pane.

Use Debug.Break(), which pauses the editor. Or, if you have "Error pause" selected in the console, you can use Debug.LogError(), which will also pause the editor.