Anonymus function in Javascript

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 Reply