Apparently, neither jsFiddle, nor codepen.io support ES6 syntax (e.g. running let x = 10
will throw an error - see for yourself).
Obvious choice would be es6fiddle, but it produces clearly false results (block-scoped variable i stays defined out of scope).
Is there any snippet runner at all, supporting ES6?
You could try Babel. I don't know how it works under the hood, but Ember.js is using it as an ES6 polyfill, so it should be pretty reliable. They provide a web-based console for you to play around with. It shows you what your ES6 code ends up being transformed into: https://babeljs.io/repl/
The particular problem you are seeing is due to a bug in Traceur, the ES6 to ES5 transpiler that many snippet runners use to add "ES6 support." You'll find that such runners are generally limited by the software running them, and in the case of Traceur, that means usually-excellent, but sometimes-buggy, ES6 support.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With