ecmascript 6

We now support ECMAScript 6 (ES6) keywords and its built-in functions!

ECMAScript 6 (ES6) or ECMAScript 2015 is the new generation of JavaScript. In the past, while you could have still written ES6 code in Liveweave (since the rendering is dependent on the browser), it did not really have the support for ES6 keywords and its built-in functions as a part of its code-hinting technology.

Now we do!

If you want to learn more about ES6, here is a great tutorial to write object-oriented JavaScript using “classes” (ES6):

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes

A quick example of ES6 code is below (using “class” to build an object):

class Car {
constructor(brand) {
this.carname = brand;
}
present() {
return 'I have a ' + this.carname;
}
}

We are also currently working on a new documentation (or rather a cheatsheet) for JavaScript/ECMAScript 6 in the meantime. So, stay tuned!