BlogPost_205

  1. Can you offer a use case for the new arrow => function syntax?
let obj = {
myVar: 'foo',

myFunc: function() {
console.log(this.myVar)

setTimeout(function() {
console.log(this.myVar)
}, 1000)
}
}obj.myFunc() // foo ... then... undefined

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store