The construct is called an arrow function. It has been introduced with the ES2015 standard and works similar the the function() {}
syntax.
For more infos, check the MDN docs.
Note that this syntax is not yet supported by all browsers, especially older versions, so you should look into transpiling it into ES5 compliant JavaScript.
The reason why your attempt to transform it into a classic function() {}
fails is that classic functions define their own this
value, while arrow functions use the this
value of the surrounding function. This is why this.updateItems
cannot be found anymore.
To resolve this, bind the function context manually:
$.ajax({
url: '/items/' + item.id,
method: 'PUT',
data: {item: item},
success: function() {
this.updateItems(item);
}.bind(this)
});