I'm trying run a function in return of another function:
var my_func = function(func){
if(typeof func=="function") return func;
}
my_func(function(){
alert('hello world!');
});
but it does not work!
You need to call the function
var my_func = function (func) {
if (typeof func == "function") return func();
// ^^ call function
}
my_func(function () {
alert('hello world!');
});
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments