Skip to content

Instantly share code, notes, and snippets.

@polarity
Last active August 29, 2015 14:08
Show Gist options
  • Save polarity/75e904d9527744bc83f4 to your computer and use it in GitHub Desktop.
Save polarity/75e904d9527744bc83f4 to your computer and use it in GitHub Desktop.
Sometimes you have to secure a method with a condition. But you also get one more indentation space. Is it okay to use something like in the second case? less secure or safe maybe? just asking
// Whats Better?
// more indentation
function myFunction(data){
if(data){
// do some important stuff
data.parse()
}
}
// or (lee identation)
function myFunction(data){
if(!data){ return false; }
// do some important stuff
data.parse();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment