I have following methods:
function do(name){}
function name(text){
alert(text);
}
what if I want to make something like:
do(name('123456789')) {}
Is that possible and how I manage to do that?
I have following methods:
function do(name){}
function name(text){
alert(text);
}
what if I want to make something like:
do(name('123456789')) {}
Is that possible and how I manage to do that?
Do is a Reserved word, try this:
function make(nameFunction,argFunction){
nameFunction(argFunction);
}
make(name,"works");
function name(text){
console.log(text);
}
You just return value from function that you are going to pass as parameter to other function and now value of parameter in that function is returned value from other function that you passed.
function x(param){
return param + 1;
}
function y(param){
return param + 1;
}
console.log(y(x(1)))