Jump to content
Larry Ullman's Book Forums

Use Return Twice In A Javascript Function


Recommended Posts

Function A has called function B, executed a few lines, and now I want to return to function A and execute the underlined part of this:

 

function A(){

    ....

    ....

    B();

}

function B(){

    ....

    ....

    return [return true];

}

 

The first return is for function B. The second return is for function A. Of course, I can just put the underlined code in function A after calling function B, but in this case I want to assign the code as a part of the function B return.

 

As written, the above code does not work; the second return on the line causes a syntax error. Is there a way to do this?

 

Thanks.

Link to comment
Share on other sites

 Share

×
×
  • Create New...