| The function in JavaScript are of two type either named or anonymous. As the name suggest A named function can be defined using function keyword as given below
function nameoffunction(){
// do some code here
}
On the other hand an anonymous function can be defined in same way as we defined normal function but it doesnot have any name. We can use anonymous function to assigned to a variable or passed to a method as given below.
var handlerVar = function (){
// do some code here
} | | |