Anonymus function in Javascript

Share on facebook
Share on twitter
Share on linkedin
Share on twitter
Share on tumblr
In this tutorial, we will learn the concept of Anonymous function in Javascript and how to define named function and anonymous function in Javascript.

WHAT IS A NAMELESS FUNCTION IN JAVASCRIPT?

A nameless function is said to be an Anonymous function in JavaScript.
Note: We can also assign a function to a variable.

DEFINING A NAMED FUNCTION USING VAR

var a= function demoFunction() {
console.log("Function with name");
}
a();

DEFINING AN ANONYMOUS FUNCTION USING VAR

var b=function() {
console.log("Anonymous function");
}
b();// Function without name

Leave a Comment

Your email address will not be published. Required fields are marked *