I have a small if statement that runs when a function is run. The issue is that the variable timeout_value is always defined as 0 even after the if statement executes successfully. What am I doing wrong?
//update on interval
var timeout_value=0;
//set interval based on number of users
if (json.countusers==2 && timeout_value!=3){
alert(timeout_value);
timeoutID2 = setInterval(refresh, 3000);
timeout_value=3;
}