Normal functions of es5
Arrow functions of es6
uhmm! its looking like so easy in es6.
It’s too easy to use the functions in es6 and also a lot of advantages over the normal functions. if you wanted to use context of current class in callback function or other function then you can easily use this in arrow function because it internally binds the context of current class with arrow functions. let quickly review the example of both
You will get the output undefined in alert log because this.a is not scope of object.
it will alert 1 in because this is es6 arrow function syntax.
I hope it will help you to understand arrow functions.