---
title: "What is an anonymous function in Javascript ?"  
description: "What is an anonymous function in Javascript ?"  
author: "Anonymous User"  
published: 2019-04-05  
updated: 2020-09-13  
canonical: https://www.mindstick.com/interview/23492/what-is-an-anonymous-function-in-javascript  
category: "javascript"  
tags: ["javascript"]  
reading_time: 1 minute  

---

# What is an anonymous function in Javascript ?

This is a function that has no name or without a name. These type of functions are declared dynamically at runtime using the function operator instead of the function declaration. A function operator is more flexible than a function declaration. It can be easily used in the place of an expression.

```
For example:-
var display=function()
{
  alert("Anonymous Function is invoked");
}
display();  
```

## Answers

### Answer by Anonymous User

This is a function that has no name or without a name. These type of functions are declared dynamically at runtime using the function operator instead of the function declaration. A function operator is more flexible than a function declaration. It can be easily used in the place of an expression.

```
For example:-
var display=function()
{
  alert("Anonymous Function is invoked");
}
display();  
```


---

Original Source: https://www.mindstick.com/interview/23492/what-is-an-anonymous-function-in-javascript

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
