Created
November 8, 2011 04:52
-
-
Save emkay/1347026 to your computer and use it in GitHub Desktop.
global antipattern
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
function sum(x, y) { | |
// antipattern: implied global | |
result = x + y; | |
return result; | |
} | |
function sum(x, y) { | |
var result = x + y; | |
return result; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment