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.

Leave a Reply

Your email address will not be published.

Required fields are marked *

You may use these HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>