Google News
logo
TypeScript - Interview Questions
What is an anonymous function?
An anonymous function is a function that is declared without any named identifier. These functions are dynamically declared at runtime. Also, anonymous functions can accept inputs and return outputs, just as standard functions do. It is usually not accessible after its initial creation.
 
Example :
let myAdd = function(x: number, y: number): number { 
return a+b; 
}; 
console.log(myAdd())
Advertisement