I want to run function sent as parameter on JavaScript, for example I create this script, I want from this script to print "successful test" but the script print the whale function as text. Thus, how can I run a function sent as parameter to the function?
test=function (p1) {
return p1;
}
var result=test(function(){
return "successful test";
});
console.log(result);
return p1();return p1()rather thanreturn p1