I wrote these simple code,
function a()
{
function b()
{
function d()
{
if (/*required condition goes here and should stop execution of
function a()*/)
{
return
}
}
d()
}
function c()
{
alert ('c')
};
b();
c();
}
What I expected is the execution aborts when it meet the required condition on function d() and cancelling the execution of function c(). Otherwise, it runs the remaining function after executing function b().
How can I do that?
Edit: What I actually want to know wheter if the 'return' key colud terminate immediately for the outer function like 'Exit Sub' on VB.Net
function dcould return a value which you match later to then return if it matches an expected value.