Inspect values in the console
Use console.log(), console.info(), console.warn(), console.error() and console.table() to inspect values, objects and arrays. Filter messages or clear the output. Logging an error does not stop the script.
Build interactive calculations and document content in the Code workspace. Inspect console output, find errors and use supported JavaScript libraries before reviewing your document for printing or PDF.
const quantity = 3;
const unitPrice = 12.5;
const total = quantity * unitPrice;
console.log({ quantity, unitPrice, total });
▸ {quantity: 3, unitPrice: 12.5, total: 37.5}Example preview. Your code runs only when you press Run in the editor.
Use console.log(), console.info(), console.warn(), console.error() and console.table() to inspect values, objects and arrays. Filter messages or clear the output. Logging an error does not stop the script.
Syntax checking highlights invalid code before execution. Runtime exceptions and unhandled promise rejections appear with a stack trace and, when available, a clickable source line and column.
Select a supported library above the JavaScript editor. The selected versions load with your document and the selection is preserved with the saved source.
Open the editor, choose Code and enter your document markup in the HTML view. CSS can be included in a style element.
Add calculations and supported document events. If your code uses jQuery or React, select that library above the source editor.
Press Run or Ctrl+Enter / ⌘+Enter. Check the interactive preview and console. Use a reported source location to return to the code and fix an error.
Review the result, save your document and print or export PDF. Form values become static content in the printable document.
Copy the HTML into the HTML view and the script into the JavaScript view. This example needs no library. Run it to display the total and inspect the calculation in the console.
<h2>Price calculation</h2>
<p id="total"></p>const quantity = 3;
const unitPrice = 12.5;
const total = quantity * unitPrice;
console.log({ quantity, unitPrice, total });
document.querySelector("#total").textContent = total.toFixed(2);| Library | Available names | Typical use |
|---|---|---|
| jQuery 3.7.1slim | $ · jQuery | Select elements, update text and respond to supported events. The slim build excludes Ajax and effects. |
| React 18.3.1+ ReactDOM 18.3.1 | React · ReactDOM | Build components and update state using |
Library selection is stored as source comments. Supported pinned CDN imports are recognized during HTML import and use the bundled copies. Other external scripts and module scripts are omitted.
Imported and restored scripts remain stopped until you press Run. Scripts use an isolated virtual document, and unresponsive scripts are stopped so the editor remains usable.
Use supported document elements and input, change, click, keydown, keyup, focus, blur and submit events. Full browser layout APIs, network requests, cookies and browser storage are unavailable to the script.
The console displays values and error locations. Breakpoints, step-through debugging, live expression evaluation, module loading and JSX compilation are not provided.
The printable snapshot contains the document result. Scripts and buttons are excluded; input values are converted to text or checkbox symbols. Check the result before exporting.
No. It records an error-level message. A thrown exception or an unhandled promise rejection is reported as a runtime failure and stops execution.
Use the jQuery and React options offered in the editor. Arbitrary external script URLs and JavaScript modules are not loaded. The supported pinned libraries are bundled locally.
No. Printing and PDF export use the static document result. Your source and library selection remain part of the saved editable document.
Open Code, add your source and use the console to verify the result before printing.
Open editor