I am using nested functions
Function mainfunction (callbackfun) {
//some code + function (score)
{
var score = scoreString;
alert(scoreString);
callbackFun(score);
}
} //--> I return this value to my calling function
mainfunction(function (anystring){
alert(anystring); //-> this would return me the value in callbackfun
});
What I want is access that value in anystring out like
var fetchvalue ;
mainfunction(function (anystring){
fetchvalue =anystring; //-> this would return me the value in callbackfun
});
Please guide me if am on the right track .
functioninstead ofFunctionand your parameter is namedcallbackfun, notcallbackFun. With this fixed, this is what your code is doing: jsfiddle.net/P3bBP. Is this what you want?