I am just playing around with arrow functions, and tried using them as a property in an object literal, like so:
var obj = {
a: () => {
return this;
},
b: function () {
return this;
},
};
But, when I test this, I can't quite explain what the this
returned from obj.a()
is.
console.log(obj.a()); //=> {}
console.log(obj.b()); //=> { a: [Function], b: [Function] }
Is it obj
's prototype?