Evaluate JavaScript against the simulator
eval_jsRun arbitrary JavaScript inside CircuitJS1, using the sim object to inspect components and return JSON-serializable results.
Instructions
Advanced escape hatch: run arbitrary JavaScript inside the CircuitJS1 page. The code is the body of an async function receiving sim (the CircuitJS1 object, see https://www.falstad.com/circuit/doc/js-interface.html). Return a JSON-serializable value. Example: "return sim.getElements().filter(e => e.getType()==='ResistorElm').map(e => e.getCurrent())".
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes |