Skip to content

Instantly share code, notes, and snippets.

@rrostt
Created November 13, 2014 11:54
Show Gist options
  • Save rrostt/a39eb70bdad3038b1950 to your computer and use it in GitHub Desktop.
Save rrostt/a39eb70bdad3038b1950 to your computer and use it in GitHub Desktop.
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();
@rrostt
Copy link
Author

rrostt commented Nov 13, 2014

// this is ironic...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment