Variables in the JavaScript Debugger
In the
JavaScript Debugger , the
Variables section displays the current values of variables at the point where the debugging execution is paused. If required, you can change the variable values.
The Variables section includes the following tabs:
Scope Tab
The Scope tab shows the state of the stack frame that is being viewed or debugged and any known variables declared in that section of the code. It displays the variable name in blue text followed by a colon separator and the variable’s value.
Scope variables are updated when changes are made to the system, either by stepping through the code or making changes in the
Terminal tab. For more information about stepping through the code, see
Debugger Toolbar.
Watch Tab
The Watch tab allows you to declare variables that you want to monitor as you debug the code. You can define variables to watch in both edit and debug modes.
If you define variables to watch in edit mode, their values appear empty. When you are stepping through the code or making changes in the Terminal tab, the variables that you set to watch are updated.
The Watch tab consists of the following:
• Toolbar that contains buttons that allow you to add variables to watch, refresh the status of your defined variables to watch, and clear all variables marked to be watched.
• Variable names and their current values.
• The

option next to each variable.
|
|
If a variable is not recognized in the stack frame currently being debugged, the value displays <not available>.
|
To add a new variable to watch, perform the following steps:
1. Click

and enter the variable name in the box.
2. Press Enter or click outside the box.
The variable is added to the watch list.
Terminal Tab
The Terminal tab works like a debug shell. It displays variables and allows you to set their values at runtime. You can only update primitive values, such as string, number, and Boolean values. You can run a JavaScript condition or expression and view the result in the Terminal tab. Unlike variables set to be watched, expressions are executed once and are not updated as you debug the service. Expressions are saved with your username. You can use the toolbar to clear all expressions.