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

Shopping cart