Arrow Functions in ES6

Arrow Functions in ES6 syntactically compact alternative to a regular function expression Arrow functions syntax’s ES6. Arrow functions are of three types:

  1. Multiple Parameters
  2. With Only one parameter
  3. No Paramters

Arrow Functions in ES6

Arrow Functions in ES6

1.WIth Multiple Parameters:

Now how arrow functions are rewritten with respect  to normal functions. For now we have just a regular function which can be converted as

Can be rewritten with ES6 arrow functions as follow

Now above function is compact one

2.With Only one parameter:

Regular javascript function

Now it has some different syntax than the normal java script functions

3. No Paramters:

 

 

 

 

 

Leave a Reply

Your email address will not be published. Required fields are marked *