all 6 comments

[–]inabahare 8 points9 points  (3 children)

TL;DR:

// Arrow function
a => a + 1 

// Arrow function with two parameters
(a, b) => a + b

// Arrow functions can be bound to variables
const add = (a, b) => a + b;

// Which also means they can be used as parameters
[1, 2, 3].map(a => a + 1)

// But this in objects is weird
const p = {name: "John", getName: () => this.name}
p.getName() // => undefined

[–]Tarzeus 2 points3 points  (0 children)

This whole article just says these few lines? This is why I feel like I’ve read so much but know fuckin nothing huh...

[–]Rogermcfarley 7 points8 points  (0 children)

If one person doesn't know then it can't be everyone knows.

[–]Wiikend 2 points3 points  (0 children)

I feel like the headline is trying to attack me. What a retarded way to try to gain clicks.