Friday, December 11, 2009

Fun Fact #372

Remember, Javascript, like most languages, short-circuits when dealing with if statements.

What does that mean?

Well for example, when running an OR evaluation with two functions, such as
if(doThis(var1) || doThat(var2){ alert("Woot!"); }
If the first function is true, the second function will not execute.

Something to keep in mind for future reference if you're wondering why your function's not running.

No comments: