node.js - What is the "=>" syntax in nodejs? -


i'm wondering difference between anonymous function:

callback = function (a) {return a} 

and using "=>" notation?

callback = (a) => {return a} 

is more syntactic sugar?

() => called arrow function of javascript, introduced in ecma script 6. it's useful more intuitive handling of current object context.

reference link new features of ecma script 6.


Comments

Popular posts from this blog

php - How to add and update images or image url in Volusion using Volusion API -

Laravel mail error `Swift_TransportException in StreamBuffer.php line 269: Connection could not be established with host smtp.gmail.com [ #0]` -

c# SetCompatibleTextRenderingDefault must be called before the first -