An anonymous function is one that has no name. Anonymous functions can be sent as a parameter to other functions.
let display = function() {
console.log('This is anonymous function');
};
display();
}
This is anonymous function
The anonymous function in the preceding example has no name between the function keyword and the parentheses.
setTimeout(function() {
alert('anonymous function');
}, 1000);