Created
October 20, 2011 21:07
-
-
Save joshkehn/1302387 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
var Laws = { | |
drinking_age : function (age, fn) { | |
fn(age > 21); | |
} | |
} | |
Student.prototype.check_drinking = function check_drinking (fn) { | |
Laws.drinking_age(this.age, function (able_to_drink) { | |
if (able_to_drink) { | |
fn(null, true); | |
} else { | |
fn(this.age + " does not meet the minimum drinking age.", false); | |
} | |
}); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment