Advertisement
Guest User

Untitled

a guest
Mar 4th, 2015
212
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. function abc() {
  2. if (some_condition) {
  3. message('blah');
  4. return; // early exit
  5. }
  6. // otherwise do stuff
  7. }
  8.  
  9. function check_condition() {
  10. if (some_condition) {
  11. message('blah');
  12. return false; // early exit
  13. }
  14. else
  15. return true;
  16. }
  17.  
  18. function abc() {
  19. if (!check_condition()) {return;}
  20.  
  21. // otherwise do stuff
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement