JSFiddle - React, Tailwind, and code Playground
by Andra Jimenez
JavaScript
//This is assingment 2 version 2
function Birthday(date) {
this.date = date;
}
Birthday.prototype.isDateMyBirthday = function (checkdate) {
if (this.date.getDate() == checkdate.getDate() && this.date.getMonth() == checkdate.getMonth()) {
return true;
} else {
return false;
}
Birthday.prototype.isTodayMyBirthday = function () {
return (isDateMyBirthday(new Date()));
};
};
// instantiate object
var andrea = new Birthday(new Date("02-23-1987"));
console.log(andrea.isDateMyBirthday(new Date("02-23-1987")));
console.log(andrea.isTodayMyBirthday());