# Step Execution with JS-Interpreter

This is a demo of executing code step-by-step with a sandboxed JavaScript interpreter.

The generator's `javascript.javascriptGenerator.STATEMENT_PREFIX` is assigned `'highlightBlock(%1);\n'`, where `%1` is the block ID. The call to `highlightBlock()` will highlight the identified block and set the variable `highlightPause` to `true`.

Each press of the "Step JavaScript" button will run the interpreter one step after another until `highlightPause` is true. That is, until `highlightBlock()` has highlighted the block that will be executed on the next step.

→ More info on running code with JS-Interpreter