Guest User

Untitled

a guest
Jun 19th, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. foo (a) ->
  2. if x? then y
  3. # generates
  4. # foo(function(a) {
  5. # return (typeof x !== "undefined" && x !== null) ? y : undefined;
  6. # });
  7.  
  8. # However, if you are checking for the existence of a param to the function, then no undefined check
  9. foo (x) ->
  10. if x? then y
  11.  
  12. # foo(function(x) {
  13. # return (x != null) ? y : undefined;
  14. # });
Add Comment
Please, Sign In to add comment