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(){





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?



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.
Note: Your post will require moderator approval before it will be visible.

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.

  • Create New...