I am executing some code based on condition of a particular variable and i am modifying the same variable inside the code.. How can i stop the if condition checking once the condition is met? When the else if condition is met and date2 is getting null the code is going back and checking if date2===null and executing both the condition.
if(date){
if(date2===null) {
//block of code
date2 = date;
}
else if(date2){
//block of code
date2 = null
}
}