JS-Interpreter Babel Demo

A transpiler is required to run ES6 or greater using the JS-Interpreter. Babel is a good option which can generate ES5 either client-side or server-side.

For client-side transpiling, download @babel/standalone and include it as a script tag on your page. Then convert your code like this:

code = Babel.transform(code, {'presets': ['es2015']}).code;

One issue is that highlighting the user's code as it executes won't work since it is the transpiled code that's actually being executed and the line numbers won't match.

Type some ES6, click Parse, then click Run once. Open your browser's console for errors.


Back to the JS-Interpreter documentation.