Skip to content

Instantly share code, notes, and snippets.

@nicobytes
Last active June 3, 2016 14:49
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 nicobytes/adfcb3cb8a208e6c5805 to your computer and use it in GitHub Desktop.
Save nicobytes/adfcb3cb8a208e6c5805 to your computer and use it in GitHub Desktop.
refactoring
/* Avoid */
var abc = function(z) {
var x = false;
if( z > 10 ){
return true;
}
return x;
};
/* Recommend */
var isTenOrGreater = function( value ){
if( value > 10 ) return true;
return false;
};
/* More Recommend */
// Why does this method exist in the first place?
var isTenOrGreater = function( value ){
return value > 10;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment