Last active
June 3, 2016 14:49
-
-
Save nicobytes/adfcb3cb8a208e6c5805 to your computer and use it in GitHub Desktop.
refactoring
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* 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