Global
This part of the documentation describes the global objects and methods available in the Javascript console.
Execute arbitrary Javascript expressions
Argument | Type | Description |
expression | String | The JS expression to execute |
> exec("console.log(10 + 10)")
// Output: 20
Fetch and execute a Javascript file
Argument | Type | Description |
filePath | String | The absolute path of a JS file. |
In Console
file.js
> runScript("file.js")
// Output: 20
console.log(10 + 10)
Pretty print an object. Useful for debugging.
Argument | Type | Description |
obj | Any | The object to pretty print |
> pp({ name: "Gwen" })
// Output:
{
"name": "Gwen"
}
Last modified 4yr ago