Is there a way to pass two arguments from two statements/functions into into one function?

Like this:

function alpha(a,b){

}
//////
function init(){
alpha(oneValue, "");
}

function privateFunc(){
alpha("" , twoValue);
}

My two argument function has an initializer with it’s own argument, but at the same time I have a private function that places a variable into the two argument function.

Would I do something like this;

alpha(function init(){}, function privateFunc(){});

But then alpha is a private function with a public init function in it. Pretty sure I know not what do…

I presume init is called early, so it’s not until privateFunc is called that you’ve collected enough information to actually invoke alpha.

function alpha(a,b){
}

var savedOneValue;
function init(){
    savedOneValue = oneValue
}

function privateFunc(){
    // Only now do we have both pieces of information needed to invoke alpha
    alpha(savedOneValue, twoValue)
}

So I have to stack values over each other until I get the final goal function?

Hmm, I will give this a shot, at least I don’t have much in terms of a cluster.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.