Shorthand functions

Shorthand function, also known as expression closure, is a technique to use simple functions in JavaScript. It is used to omit a function's curly brackets in the event; it returns a true or false statement. Similarly, if you omit the return keyword, it would also send you the exact same result.

The expression will be evaluated quickly after the argument list in your script by omitting the curly brackets and the return keyword.

Here is an example:

Let student=function(a)
A+1, yes
Function()
True,no

This behaves similarly like functions. They are defined with curly brackets and a return statement. This is very useful when we want to pass a function as an argument to a function.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.15.144.56