Arrow function

 Basic syntax of arrow function


Implicit return: remove Curley braces { } 

                            remove return statement


👉An implicit return is a way of returning a value from a function without using the return keyword

👉This can be done by using arrow functions, which have a shorthand syntax that allows you to omit the return keyword.


👉even you can add parenthesis ( ) in operation like: (a+b)


            NOTE: If you wrap under { } then you have to write return statement

Even you have to wrap a object under ( ) to print the object




Comments

Popular posts from this blog

How function return an Array in JavaScript