94
rated 0 times
[
96]
[
2]
/ answers: 1 / hits: 69973
/ 12 Years ago, thu, may 17, 2012, 12:00:00
I have two variables:
var trafficLightIsGreen = false;
var someoneIsRunningTheLight = false;
I would like to trigger an event when the two variables agree with my conditions:
if(trafficLightIsGreen && !someoneIsRunningTheLight){
go();
}
Assuming that those two booleans can change in any moment, how can I trigger my go()
method when they change according to the my conditions?
More From » javascript