Advertisement
Guest User

Untitled

a guest
Oct 31st, 2014
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. if (typeof someFunc === "function") {
  2. var result = someFunc.apply(this, arguments);
  3. // if someFunc returns a non-false value, end execution
  4. if (result) {
  5. return result;
  6. }
  7. }
  8.  
  9. // if there's no someFunc or someFunc returned 'false',
  10. // 'null', 'undefined', '', 0, hell-knows-what-else ...
  11. // note, that we don't return anything here
  12. otherFunc.apply(this, arguments);
  13.  
  14. return (typeof someFunc === "function"
  15. ? someFunc.apply(this, arguments)
  16. : void 0) || otherFunc.apply(this, arguments);
  17.  
  18. return (c
  19. ? someFunc.apply(this, arguments) || undefined
  20. : undefined)
  21.  
  22. //Unless f is a function and returns a non false value, return undefined
  23. return f instanceof Function ? f.apply(this, arguments) || undefined : undefined;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement