how to exit a function?

Options
I have a function with a pretty extensive conditional tree.  There are a few points where if a condition is met, I'd ideally like to end the function and send back the response.  

What's the best way to do this?

The stop and debug does that - but is described as a testing tool - and requires setting up its own response.  Not a big deal, but just made me want to confirm best approach.

Thanks!

Comments

  • Michael Udinski
    Michael Udinski Administrator

    ADMIN

    Options
     you'll want to make sure your conditionals are set up in a way so when that condition is met nothing else in the function stack runs. 

    The other part to this is naming all potential responses as the same return variable and adding that as your response