What Is A Function in javascript | Anonymous Functions
#Function_in_javascript #javascript #function #Anonymous #Functions #documentreadyjavascript
A Javascript function is a collection of statements either named or unnamed that can be called from elsewhere in a JavaScript program.
A function will be executed by an event or an explicit call to the function.
Functions can be defined in both <head> and <body> section but generally are placed in the head section.
Example :
function <function name>(var 1,var 2. . .)
{
// some code return (variable or value);
}
A function definition can be directly assigned to a variable .
This variable is like any other variable except that it’s value is a function definition and can be used as a reference to a function.
Syntax:
var variablename = function(Argument List)
{
//Function Body
};