8

Me right now: finally understood arrow function and writing everything in arrow with joy

Comments
  • 4
    Beware of implications with context (this)
  • 1
    @black-kite With how things are usually written these days, it's very rare that you have to address the function itself (i.e. the "this" that changes).

    @miladiashe There's really nothing much to this - for me it's mostly syntactic sugar and a less cumbersome syntax at that.
  • 0
    I finally understood arrow functions then realized the code I was using them in had to be uploaded to Google Tag Manager and thus had to be ECMA5 compliant 😧
  • 2
    @jeeper Babel is your friend. TypeScript is too.

    Unless you're writing something very short in a do-it-once-and-forget-about-it manner, you don't have to treat the code you're editing as the code that's going to be used for something unchanged and untouched; there's almost always a build step that deals with bundling/transpilation and compatibility.
Add Comment