Last active
August 2, 2016 16:45
-
-
Save VictorMedeiros/18746a9a505dceb1e07fde25f7bfb29a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var calculate = { | |
array: [1, 2, 3], | |
sum: () => { | |
console.log(this === window); // => true | |
return this.array.reduce((result, item) => result + item); | |
} | |
}; | |
console.log(this === window); // => true | |
// Throws "TypeError: Cannot read property 'reduce' of undefined" | |
calculate.sum(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment