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!');
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With