Why can't I access `this` within an arrow function? [duplicate]
问题 This question already has answers here : What does “this” refer to in arrow functions in ES6? (7 answers) Closed 4 years ago . This code below should work as expected, and log "meow" , here an example. function Cat () { this.animalNoise = 'meow' } Cat.prototype.sound = () => { console.log(this.animalNoise) } let cat = new Cat() cat.sound() It doesn't work, this error appears TypeError: Cannot read property 'animalNoise' of undefined and when you convert the arrow function to an actual