Answers for "javascript passing anonymous function as parameter"

2

We often use anonymous functions as arguments of other functions. For example:

setTimeout(function () {
    console.log('Execute later after 1 second')
}, 1000);Code language: JavaScript (javascript)
Posted by: Guest on May-01-2021
0

anonymous function parameters javascript

function caller(otherFunction) {
     otherFunction(2);
 }
caller(function(x) {
    console.log(x); 
});
Posted by: Guest on August-01-2021

Code answers related to "javascript passing anonymous function as parameter"

Browse Popular Code Answers by Language