Skip to content

CONSOLE

Use the CONSOLE predefined object to print messages. In Studio, messages are displayed in the Output tab of the Console tool window.

This object has two methods:

  • log
  • error

Use log to print information messages (displayed preceded by the "i" icon) and error for error messages (displayed preceded by the "exclamation mark" icon).

For example, with this code:

var jsonObj=JSON.parse('{"name":"John", "age":30, "job":"developer"}')
CONSOLE.log(JSON.stringify(jsonObj))

you will get in the console:

{"name":"John", "age":30, "job":"developer"}

The syntax is:

CONSOLE.log(message)

and:

CONSOLE.error(message)

where message is the message (string) to print.