shaneg 0 Posted April 1, 2013 Report Share Posted April 1, 2013 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. Quote Link to post Share on other sites
Larry 429 Posted April 1, 2013 Report Share Posted April 1, 2013 Have function B() return whatever value you want. Then having function A() do this: return B(); Quote Link to post Share on other sites
shaneg 0 Posted April 1, 2013 Author Report Share Posted April 1, 2013 Aaaah, that is slick! (And works exactly as I needed.) Quote Link to post Share on other sites
Recommended Posts
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.