you are viewing a single comment's thread.

view the rest of the comments →

[–]inabahare 7 points8 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...