| Example of Anonymous and Named function with example?
Well in below example we have define two two of functions.
(1)Anonymous Function
(2)Named Function
Function expressions define functions as values assigned to variables or properties. In below code "multiple" and "divide" function are defined as function expressions. Here in below example "multiply" function is anonymous and "divide" function has a name. And they are assigned to variables and invoked accordingly. Below code is saved in .js file name as test.js.
And to run above file we will use below command in node command prompt.
node test.js
and output of above code is given below.
| | |