Explain the named function in javascript with example

 We are going to learn here about named function in javascript. Let's understand first what is named function.

Named Function: A function which is define with a name at the time of definition is called named function

Syntax: 

            function function_Name(param1, param2){

                    function body

               }

        function_Name();

Example: function Hi(name){

        alert("Hello "+name);

}

Hi("Dev");

Output: Hello Dev



No comments:

Post a Comment