I would like to increment property SCountDown
of an object pomodoro
with
method customization
, which has an argument chooseSession
and this method
is called within sessionPlus
method passing SCountDown
as an argument.
when i call sessionPlus
method , SCountDown
property increments for
once and when it is called for second time and so on , It doesn't increment.
Here's my code:
pomodoro = {
SCountDown: 0,
customization: function(chooseSession) {
chooseSession++;
console.log(chooseSession);
},
sessionPlus : function() {
this.customization(this.SCountDown);
}
}
pomodoro.sessionPlus(); // it returns 1 , this is what i needed but
pomodoro.sessionPlus(); // it also returns 1, but what i need is 2.