Untitled

mail@pastecode.io avatar
unknown
plain_text
3 years ago
570 B
1
Indexable
Never
let myTodo = {
    day: 'Monday',
    meetings: 0,
    meetDone: 0,


    adMeetings: function(num){
        this.meetings += num
    },

    meetingDone: function(num){
        this.meetDone += num
        this.meetings -= this.meetDone
    },

    resetMeetings: function(){
        this.meetings = 0
        this.meetDone = 0
    },

    summary: function(){
        return this.meetings
    }
}

myTodo.adMeetings(5)
myTodo.meetingDone(2)


console.log(`Hey on ${myTodo.day}, you've done '${myTodo.meetDone}' meeting(s) & '${myTodo.summary()}' meetings pending..`);