loading...

re: Simple concepts of Modern JavaScript VIEW POST

TOP OF THREAD FULL DISCUSSION
re: Just to clarify: the intention of arrow functions is not simply to be a shorthand for a normal function; though in practice they do often get used ...
 

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

 

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);
code of conduct - report abuse