JavaScript Arrow Functions and this scoping

We've learned about the concise syntax of arrow functions. We've learned about the implicit return of arrow functions. The last thing we're…

Wes Bos

tooltip.selectAll('text').each((d, i) => {
console.log(this)
})

tooltip.selectAll('text').each(function(d, i) {
console.log(this)
})

The callback using a vanilla anonymous function works. Arrow functions, why have you shown me my ignorance?

#d3 #javascript #arrowfunction

Chiedo #mastoaiuto al fediverso!
Voglio imparare #Javascript in maniera ordinata; in realtΓ  voglio imparare #Svelte, ma mi mancano concetti importanti come i #pattern #promise e #await/#async, nonchΓ© le #arrowFunction e la #callback.
Insomma, mi manca tutto 😬😬😬

Da dove cominciare? #libri, #video, #corsi, #tutorial…

[Segue traduzione / translation ahead]

PlayedTricks::wonByTeam() #wdebelek #arrowfunction #php