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