ECMAScript 6 has been around for a while now and whilst browser support is incomplete, it is becoming more ubiquitous across the web.

So, can you make use of some of the newest JavaScript features and syntax in your APEX applications?

Of course! Browser compatibility depending.

Let's look at how an ES5 apex.server.process call could be changed to use ES6 arrow functions. The call returns an array of people and outputs names to the console. The ES6 version is much more concise and arguably simpler. Try it a modern browser :-)

ES5 Version
var callback = function (persons) { (person) {

   .then(function (data) {
ES6 Version
var callback = persons =>
   person => {console.log(}

   .then(data => {callback(data)});

For more information on all ES6 features, check out the excellent MDN documentation or the site.