Skip to main content

JavaScript Shell

An interactive Javascript shell that can be used to execute JavaScript commands. The shell contains a console that displays error messages, warnings etc.

Options

  • code | string: JavaScript code to be evaluated. Default: ''.
  • solution | string: for programming questions, code string representing the official solution for the problem. Default: ''.
  • hints | array<(string|node)>: for programming questions, an array of hints providing guidance on how to approach the problem. Default: [].
  • precompute | boolean: controls whether the default code should be executed once the component has mounted. Default: false.
  • chat | boolean: controls whether group chat functionality should be enabled. Default: false.
  • check | string: appended JavaScript code to check the code to be evaluated. Default: none.
  • disabled | boolean: controls whether to disable all user inputs and make the code block static. Default: false.
  • lines | number: number of lines to display. Default: 5.
  • className | string: class name. Default: ''.
  • style | object: CSS inline styles. Default: {}.
  • onChange | function: callback invoked whenever the text field input changes. Default: onChange() {}.
  • onEvaluate | function: callback invoked whenever the Evaluate button is clicked. Default: onEvaluate() {}.
  • vars | object: scope object with variables that should be made available to evaluated code. Default: none.

Examples

Live Editor
Result
ReferenceError: Provider is not defined