Created
November 13, 2014 11:54
-
-
Save rrostt/a39eb70bdad3038b1950 to your computer and use it in GitHub Desktop.
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 ComparisonOfXAndY(x,y) { | |
var result; | |
this.compare = function() { | |
if (isXGreaterThanY()) { | |
result = 1; | |
} else if (isYGreatedThanX()) { | |
result = -1; | |
} | |
result = 0; | |
} | |
this.getResult = function() { | |
return result; | |
} | |
function isXGreaterThanY() { | |
return x>y; | |
} | |
function isYGreaterThanX() { | |
return y>x; | |
} | |
} | |
var comparison = new ComparisonOfXAndY(x,y); | |
comparison.compare(); | |
return comparison.getResult(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
// this is ironic...