Arrow Function in Object Literal [duplicate]

Note that the Babel translation is assuming strict mode, but your result with window indicates you’re running your code in loose mode. If you tell Babel to assume loose mode, its transpilation is different: var _this = this; // ** var arrowObject = { name: ‘arrowObject’, printName: function printName() { console.log(_this); // ** } }; … Read more