DEV Community

loading...

Discussion on: ES6, the arrow function

Collapse
jsnanigans profile image
Brendan Mullins

The arrow function is one of my favorite new additions to JavaScript, I think it's most useful to keep the scope of this consistent.

It also makes it really easy to make small functions

let a = {
  value: Date.now(),
  isMonday: _ => new Date(this.value).getDay() === 1
}

Also if you are into functional programming, the arrow functions is the best thing to ever happen to javascript

Collapse
damcosset profile image
Damien Cosset Author

Yes, I also love how it removes a lot of this pain!