Can you assign an anonymous function to a variable and pass it as an argument to another function?



Can you assign an anonymous function to a variable and pass it as an argument to another function?..

Answer / Shanky Bhatnagar

Yes, you can. In JavaScript, this is called a first-class function citizen because functions can be assigned to variables, passed as arguments to other functions, returned by other functions, and more.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More JavaScript Interview Questions

How to make a array as a stack using javascript?

1 Answers  


How many types of functions are there in javascript?

1 Answers  


Is javascript used for backend?

1 Answers  


How do you target a specific frame from a hyperlink in javascript?

1 Answers  


What is an asynchronous programming? Why is it important in javascript?

1 Answers  


What are exports and imports?

1 Answers  


Is null === undefined?

1 Answers  


What are the four basic data structures in javascript?

1 Answers  


Explain few difference between null, undefined or undeclared javascript variable?

1 Answers  


How use javascript html?

1 Answers  


How do you know if a set of points is a function?

0 Answers  


What is the most widely used programming language?

1 Answers  


Categories