Skip to content

Instantly share code, notes, and snippets.

@joshkehn
Created October 20, 2011 21:07
Show Gist options
  • Save joshkehn/1302387 to your computer and use it in GitHub Desktop.
Save joshkehn/1302387 to your computer and use it in GitHub Desktop.
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