Answer the question
In order to leave comments, you need to log in
How to execute a function after incrementing the value of a variable?
There is a function that increases the value of a variable by 1 . You need to somehow check whether the value of the StateStnum_1 variable has increased and then execute the function: flip('hoursUp' + 1, 'hoursDown' + 1, StateStnum_1, 'Single/Up/' + 2 + '/', 'Single/Down/' + 1 + '/');
Here is the code:
while (StateStnum_1!= stnum_1) {
StateStnum_1++;
flip('hoursUp' + 1, 'hoursDown' + 1, StateStnum_1, 'Single/Up/' + 2 + '/', 'Single/Down/' + 1 + '/');
if(StateStnum_1 > 9){StateStnum_1 = 0;}
console.log(StateStnum_1);
};
Answer the question
In order to leave comments, you need to log in
while (StateStnum_1 != stnum_1) {
var oldState = StateStnum_1;
StateStnum_1++;
if (StateStnum_1 > oldState) {
flip('hoursUp' + 1, 'hoursDown' + 1, StateStnum_1, 'Single/Up/' + 2 + '/', 'Single/Down/' + 1 + '/');
}
if(StateStnum_1 > 9) {
StateStnum_1 = 0;
}
console.log(StateStnum_1);
};
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question