Skip to content

Instantly share code, notes, and snippets.

@gwokae
Created May 27, 2013 03:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gwokae/5655095 to your computer and use it in GitHub Desktop.
Save gwokae/5655095 to your computer and use it in GitHub Desktop.
Polling, which style you preferred ?
// type 1
function(foo){
var bar = foo || global.defaultObject;
if(bar) bar.exec();
}
// type 2
function(foo){
(foo || global.defaultObject) && (foo || global.defaultObject).exec();
}
@johnccchang
Copy link

I prefer type 1 cuz... more readable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment