Is it possible to call a function that is nested inside a function from either outside of the original function or from inside another function?
So in the example when the func_1 is called the first time it calls the nested_func_1 and returns a value;
In the second function (func_2) is it possible to call the nested_func_1 that is nested inside func_1 and return a value?
Finally is it possible to call nested_fun_1 from outside any function and return a value?
Thanks.
function func_1(){
function nested_func_1(a){
console.log("<br/> NESTED READ");
a = a * 2;
return a;
};
b = nested_func_1(23);
return b;
};
function func_2(){
// Call function nested_func_1 that is
// nested inside func_1 and return value;
b = nested_func_1(32);
return b;
};
a = func_1();
console.log("AAA "+a);
// CALL THE NESTED FUNCTION - nested_func_1 -
// FROM inside func_2 and return result;
a = func_2();
console.log("BBB "+a);
// CALL THE NESTED FUNC from
// outside both functions;
b = nested_funct_1(23);
console.log(b);