Your functions are the same. However, these two functions are not:
var getX = () => this.x
function getX() {
return this.x
}
look at the generated js code:
var _this = this;
var getX = function () {
return _this.x;
};
function getX() {
return this.x;
}
The function defined with arrow notation () =>
captures the reference to this
when it is defined.