COMP9633 - shortest solution

by Joshua Koudys

JavaScript

function Student(birthday) { this.birthday = birthday; }
Student.prototype.checkBirthday = function(check) { return check.getDate() === this.birthday.getDate() && check.getMonth() === this.birthday.getMonth(); };
Student.prototype.isTodayBirthday = function() { return this.checkBirthday(new Date()); };

// Example execution -- not necessary for grade.
var josh = new Student(new Date("2,2,1990"));
console.log(josh.checkBirthday(new Date("2,2,2014")));
console.log(josh.isTodayBirthday());