Javascript shortcut that supports ES 6 (like jsFiddle)

Apparently neither jsFiddle nor codepen.io support ES6 syntax (for example launching let x = 10

will throw an error - see for yourself ).

The obvious choice would be es6fiddle , but it produces distinctly spurious results (i-th range variable defined out of scope).

Is there any ES6 debugger out there?

+3


source to share


4 answers


The particular issue you are seeing is due to a bug in Traceur , the ES6-ES5 transpiler that many fragment runners use to add "ES6 support." You will find that such runners are usually limited by the software running them, and in the case of Traceur, this means that usually - great, but sometimes buggy, ES6 support.



+1


source


You can try Babylon. I don't know how it works under the hood, but Ember.js uses it as an ES6 polyfill, so it should be pretty reliable. They provide a web console that you can play with. It shows you that your ES6 code turns to: https://babeljs.io/repl/



+2


source


You can now install JavaScript transpilers from http://codepen.io . One of them is babel, which enables ES6. The process is transparent.

You need to go to settings and then use the JavaScript tab.

0


source


We can use jsFiddle to run ES6 snippet. Change the language from JavaScript to Babel.enter image description here

0


source







All Articles