Jump to content
Larry Ullman's Book Forums
Sign in to follow this  
shaneg

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.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...