Short Circuits in Javascript
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.
Written by Yury Tilis
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Javascript
Authors
Related Tags
#javascript
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#