DEV Community

Discussion on: Simple concepts of Modern JavaScript

Collapse
 
pachicodes profile image
Pachi 🥑

Thank you Ben! As I mentioned, I am currently studying those concepts so your input is VERY helpful!

Collapse
 
blindfish3 profile image
Ben Calder

Happy to contribute. I have often posted my findings to forums precisely to help solidify concepts in my head and in case I had misunderstood anything. It's a really good learning process and has the benefit of helping others :)

One thing that I realised I didn't mention: a common use of arrow functions is in callbacks where you want to maintain the this context:

window.setTimeout(arrowFunction, 100);

Before arrow functions you had to use bind - which felt a little arcane:

window.setTimeout(normalFunction.bind(this), 100);