I am trying to create my own reminder application with javascript, so basically I can create a set of reminders, such as a category (work, school, programming reminders, etc.). And each of them can have its own reminders, for example, by category of work, I have a list of reminders, etc. I also want to save the sets and their reminders on localstorage and recreate them again on the page. Of course, the list of reminders should be on the set that it belongs to.
Before I make the page, I really want to model this first one, and I decided to go for the oop approach as a practice, and I figure out how to link them here, which I got so far.
var ReminderSet = function(set){
this.set = set; //could be work, school , etc
}
var Reminders = function(new_reminder){
this.reminders = new_reminder;
}
ReminderSet.prototype.reminders = new Reminders();
ReminderSet.prototype.printSet = function(){
console.log(this.set, this.reminders);
}
var workReminders = new ReminderSet("work");
var schoolReminders = new ReminderSet("school");
workReminders.reminders = new Reminders("please the boss");
workReminders.reminders = new Reminders("finish task on time");
schoolReminders.reminders = new Reminders("finish projects");
schoolReminders.reminders = new Reminders("study on chem");
workReminders.printSet();
schoolReminders.printSet();
, , , ! , javascript 3 , , oop, , , oop.