Use the Javascript Debugger console in Acrobat. Open it by pressing Ctrl+J or selectEdit > Preferences > Javascript > Javascript Debugger > Enable Javascript Debugger
Restart Acrobat to view the Debugger console when using the Preferences option.

From Designer, save the form as PDF, open it in Acrobat, and press CTRL+J to open the debugger.

Launch Acrobat in the background, open the form in Designer, and goto PDF Preview. This approach uses the Acrobat plug-in, from where pressing Ctrl+J calls up the Javascript debugger.

To execute Javascript expressions directly in the console window, enter the statement and highlight the entire statement using the cursor. (Optionally, highlight multiple lines to execute multiple lines of Javascript code.) Press Ctrl+Enter.